flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhue...@apache.org
Subject incubator-flink git commit: [FLINK-1265] Fix user classloader bug for registerInputOutput() method
Date Thu, 20 Nov 2014 16:53:52 GMT
Repository: incubator-flink
Updated Branches:
  refs/heads/master a77d75201 -> 4a74f3281


[FLINK-1265] Fix user classloader bug for registerInputOutput() method


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

Branch: refs/heads/master
Commit: 4a74f3281bd04ed76b911d2038ea8e3d9c0b7963
Parents: a77d752
Author: Fabian Hueske <fhueske@apache.org>
Authored: Wed Nov 19 22:36:38 2014 +0100
Committer: Fabian Hueske <fhueske@apache.org>
Committed: Thu Nov 20 17:50:10 2014 +0100

----------------------------------------------------------------------
 .../flink/runtime/execution/RuntimeEnvironment.java      | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/4a74f328/flink-runtime/src/main/java/org/apache/flink/runtime/execution/RuntimeEnvironment.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/execution/RuntimeEnvironment.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/execution/RuntimeEnvironment.java
index 715bbd7..ce495d1 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/execution/RuntimeEnvironment.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/execution/RuntimeEnvironment.java
@@ -177,7 +177,16 @@ public class RuntimeEnvironment implements Environment, BufferProvider,
LocalBuf
 		this.taskConfiguration = tdd.getTaskConfiguration();
 		
 		this.invokable.setEnvironment(this);
-		this.invokable.registerInputOutput();
+		
+		// make sure that user classloader is available, because registerInputOutput might call
usercode
+		{
+			Thread currentThread = Thread.currentThread();
+			ClassLoader context = currentThread.getContextClassLoader();
+			currentThread.setContextClassLoader(userCodeClassLoader);
+			this.invokable.registerInputOutput();
+
+			currentThread.setContextClassLoader(context);
+		}
 
 		List<GateDeploymentDescriptor> inGates = tdd.getInputGates();
 		List<GateDeploymentDescriptor> outGates = tdd.getOutputGates();


Mime
View raw message