You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2015/09/02 00:04:18 UTC

[1/2] storm git commit: STORM-994 Close download clients and channels to avoid resource leaks

Repository: storm
Updated Branches:
  refs/heads/0.10.x-branch d4aa742dc -> 59bbcd3aa


STORM-994 Close download clients and channels to avoid resource leaks

Conflicts:
	storm-core/src/jvm/backtype/storm/utils/Utils.java


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/94b6eab7
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/94b6eab7
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/94b6eab7

Branch: refs/heads/0.10.x-branch
Commit: 94b6eab75e9fd02f423afc4ca70634fe72d34b65
Parents: d4aa742
Author: fmazoyer <fr...@altran.com>
Authored: Tue Aug 25 14:57:59 2015 +0200
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Wed Sep 2 06:56:28 2015 +0900

----------------------------------------------------------------------
 .../src/jvm/backtype/storm/utils/Utils.java     | 23 +++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/94b6eab7/storm-core/src/jvm/backtype/storm/utils/Utils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/Utils.java b/storm-core/src/jvm/backtype/storm/utils/Utils.java
index d83b926..15e6985 100644
--- a/storm-core/src/jvm/backtype/storm/utils/Utils.java
+++ b/storm-core/src/jvm/backtype/storm/utils/Utils.java
@@ -359,14 +359,25 @@ public class Utils {
 
     public static void downloadFromMaster(Map conf, String file, String localFile) throws AuthorizationException, IOException, TException {
         NimbusClient client = NimbusClient.getConfiguredClient(conf);
-        String id = client.getClient().beginFileDownload(file);
+        try {
+        	download(client, file, localFile);
+        } finally {
+        	client.close();
+        }
+    }
+
+    private static void download(NimbusClient client, String file, String localFile) throws IOException, TException, AuthorizationException {
         WritableByteChannel out = Channels.newChannel(new FileOutputStream(localFile));
-        while(true) {
-            ByteBuffer chunk = client.getClient().downloadChunk(id);
-            int written = out.write(chunk);
-            if(written==0) break;
+        try {
+            String id = client.getClient().beginFileDownload(file);
+	        while(true) {
+	            ByteBuffer chunk = client.getClient().downloadChunk(id);
+	            int written = out.write(chunk);
+	            if(written==0) break;
+	        }
+        } finally {
+        	out.close();
         }
-        out.close();
     }
 
     public static IFn loadClojureFn(String namespace, String name) {


[2/2] storm git commit: add STORM-994 to CHANGELOG.md

Posted by ka...@apache.org.
add STORM-994 to CHANGELOG.md


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/59bbcd3a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/59bbcd3a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/59bbcd3a

Branch: refs/heads/0.10.x-branch
Commit: 59bbcd3aaab1ec5e76994cc97b26b982e377d26b
Parents: 94b6eab
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Wed Sep 2 07:03:06 2015 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Wed Sep 2 07:03:06 2015 +0900

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/59bbcd3a/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3cbff5b..2fc85bd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 0.10.0-beta2
+ * STORM-994: Connection leak between nimbus and supervisors
  * STORM-1001: Undefined STORM_EXT_CLASSPATH adds '::' to classpath of workers
  * STORM-977: Incorrect signal (-9) when as-user is true
  * STORM-843: [storm-redis] Add Javadoc to storm-redis