You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by zsxwing <gi...@git.apache.org> on 2018/08/23 20:15:38 UTC

[GitHub] spark pull request #22210: [SPARK-25218][Core]Fix potential resource leaks i...

GitHub user zsxwing opened a pull request:

    https://github.com/apache/spark/pull/22210

    [SPARK-25218][Core]Fix potential resource leaks in TransportServer and SocketAuthHelper

    ## What changes were proposed in this pull request?
    
    Make sure TransportServer and SocketAuthHelper close the resources for all types of errors.
    
    ## How was this patch tested?
    
    Jenkins


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zsxwing/spark SPARK-25218

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/22210.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #22210
    
----
commit 6f2248d45716332ac78e44b1314011806f59deb8
Author: Shixiong Zhu <zs...@...>
Date:   2018-08-23T20:10:03Z

    Fix potential resource leaks

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22210: [SPARK-25218][Core]Fix potential resource leaks i...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22210#discussion_r212443117
  
    --- Diff: common/network-common/src/main/java/org/apache/spark/network/buffer/FileSegmentManagedBuffer.java ---
    @@ -95,26 +95,24 @@ public ByteBuffer nioByteBuffer() throws IOException {
       @Override
       public InputStream createInputStream() throws IOException {
         FileInputStream is = null;
    +    boolean shouldClose = true;
         try {
           is = new FileInputStream(file);
           ByteStreams.skipFully(is, offset);
    -      return new LimitedInputStream(is, length);
    +      InputStream r = new LimitedInputStream(is, length);
    +      shouldClose = false;
    +      return r;
         } catch (IOException e) {
    -      try {
    -        if (is != null) {
    -          long size = file.length();
    -          throw new IOException("Error in reading " + this + " (actual file length " + size + ")",
    --- End diff --
    
    ditto


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22210: [SPARK-25218][Core]Fix potential resource leaks i...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/22210


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    **[Test build #95184 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95184/testReport)** for PR 22210 at commit [`6f2248d`](https://github.com/apache/spark/commit/6f2248d45716332ac78e44b1314011806f59deb8).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    **[Test build #95184 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95184/testReport)** for PR 22210 at commit [`6f2248d`](https://github.com/apache/spark/commit/6f2248d45716332ac78e44b1314011806f59deb8).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95184/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22210: [SPARK-25218][Core]Fix potential resource leaks i...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22210#discussion_r212443039
  
    --- Diff: common/network-common/src/main/java/org/apache/spark/network/buffer/FileSegmentManagedBuffer.java ---
    @@ -77,16 +77,16 @@ public ByteBuffer nioByteBuffer() throws IOException {
             return channel.map(FileChannel.MapMode.READ_ONLY, offset, length);
           }
         } catch (IOException e) {
    +      String errorMessage = "Error in reading " + this;
           try {
             if (channel != null) {
               long size = channel.size();
    -          throw new IOException("Error in reading " + this + " (actual file length " + size + ")",
    --- End diff --
    
    This is just thrown and then ignored. I assigned it to `errorMessage` so that we can see it in the error.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    Thanks! Merging to master.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    Seems okay to me too


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    cc @brkyvz 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2509/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22210: [SPARK-25218][Core]Fix potential resource leaks in Trans...

Posted by brkyvz <gi...@git.apache.org>.
Github user brkyvz commented on the issue:

    https://github.com/apache/spark/pull/22210
  
    LGTM! Good catches


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org