You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/05/28 16:15:41 UTC

[GitHub] [flink] tillrohrmann commented on a change in pull request #8543: [FLINK-12101] Race condition when concurrently running uploaded jars via REST

tillrohrmann commented on a change in pull request #8543: [FLINK-12101] Race condition when concurrently running uploaded jars via REST
URL: https://github.com/apache/flink/pull/8543#discussion_r288187118
 
 

 ##########
 File path: flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java
 ##########
 @@ -1061,8 +1064,12 @@ private static String getDefaultName() {
 	 * @return The execution environment of the context in which the program is executed.
 	 */
 	public static ExecutionEnvironment getExecutionEnvironment() {
+
 		return contextEnvironmentFactory == null ?
-				createLocalEnvironment() : contextEnvironmentFactory.createExecutionEnvironment();
+				(contextEnvironmentFactoryThreadLocal.get() == null ?
 
 Review comment:
   I would suggest to first check the thread local variable and then fall back to the static variable. That way, it would not be possible to override the value of an `ExecutionEnvironment` which has been set explicitly by from another thread.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services