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:
[email protected]
With regards,
Apache Git Services