[ 
https://issues.apache.org/jira/browse/HDFS-17902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069757#comment-18069757
 ] 

ASF GitHub Bot commented on HDFS-17902:
---------------------------------------

hadoop-yetus commented on PR #8393:
URL: https://github.com/apache/hadoop/pull/8393#issuecomment-4159367302

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m  0s |  |  Docker mode activated.  |
   | -1 :x: |  patch  |   0m 15s |  |  
https://github.com/apache/hadoop/pull/8393 does not apply to trunk. Rebase 
required? Wrong Branch? See 
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute for help.  
|
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | GITHUB PR | https://github.com/apache/hadoop/pull/8393 |
   | Console output | 
https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8393/3/console |
   | versions | git=2.34.1 |
   | Powered by | Apache Yetus 0.14.1 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   




> StripedBlockChecksumReconstructor leaks connections on init failure
> -------------------------------------------------------------------
>
>                 Key: HDFS-17902
>                 URL: https://issues.apache.org/jira/browse/HDFS-17902
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>    Affects Versions: 3.4.3
>            Reporter: yue.wang
>            Priority: Major
>              Labels: pull-request-available
>
> When BlockGroupNonStripedChecksumComputer.recalculateChecksum() allocates a 
> StripedBlockChecksumReconstructor with try-with-resources, the 
> reconstructor's constructor calls StripedReconstructor's superclass 
> constructor first, which creates a StripedReader. The constructor then calls 
> getStripedReader().init(), which in turn calls initReaders().
> If initReaders() fails because nSuccess < minRequiredSources, it throws 
> IOException. initReaders() does not close StripedBlockReader instances that 
> were already created and may already hold open block/TCP connections to peer 
> DataNodes.
> Because the constructor throws before the StripedBlockChecksumReconstructor 
> instance is successfully created, the try-with-resources statement never 
> assigns the resource variable and therefore does not invoke Closeable.close() 
> on the reconstructor (JLS: resource is only closed if initialization 
> completes normally). As a result, StripedReader.close() is never called on 
> that code path, and connections opened during the failed initReaders() loop 
> can leak.
> By contrast, StripedBlockReconstructor.run() always calls 
> getStripedReader().close() in a finally block, so the same failure mode is 
> cleaned up there.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to