flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [1/2] flink git commit: [FLINK-2913] [runtime] Ensure file streams are properly closes in FsStateBackend
Date Thu, 19 Nov 2015 16:14:28 GMT
Repository: flink
Updated Branches:
  refs/heads/master 864357bac -> 93622001e


[FLINK-2913] [runtime] Ensure file streams are properly closes in FsStateBackend

This closes #1353


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

Branch: refs/heads/master
Commit: ff52d289113560273830421eceef82028d8bc99c
Parents: 864357b
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri Nov 13 16:43:53 2015 -0800
Committer: Stephan Ewen <sewen@apache.org>
Committed: Thu Nov 19 15:27:54 2015 +0100

----------------------------------------------------------------------
 .../apache/flink/runtime/state/filesystem/FsStateBackend.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/ff52d289/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsStateBackend.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsStateBackend.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsStateBackend.java
index 045c411..d7b392c 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsStateBackend.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/state/filesystem/FsStateBackend.java
@@ -268,9 +268,9 @@ public class FsStateBackend extends StateBackend<FsStateBackend>
{
 				continue;
 			}
 
-			ObjectOutputStream os = new ObjectOutputStream(outStream);
-			os.writeObject(state);
-			os.close();
+			try (ObjectOutputStream os = new ObjectOutputStream(outStream)) {
+				os.writeObject(state);
+			}
 			return new FileSerializableStateHandle<S>(targetPath);
 		}
 		


Mime
View raw message