tweise commented on a change in pull request #11108: [BEAM-9490] Guard 
referencing for environment expiration via a lock
URL: https://github.com/apache/beam/pull/11108#discussion_r392417670
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DefaultJobBundleFactory.java
 ##########
 @@ -406,8 +438,16 @@ public RemoteBundle getBundle(
         availableCachesSemaphore.acquire();
         // The blocking queue of caches for serving multiple bundles 
concurrently.
         currentCache = availableCaches.take();
-        client = currentCache.getUnchecked(executableStage.getEnvironment());
-        client.ref();
+        // Lock because the environment expiration can remove the ref for the 
client
+        // which would close the underlying environment before we can ref it.
+        Lock refLock = environmentCacheLocks.get(environmentIndex);
 
 Review comment:
   This isn't picking the correct lock, addressed in 
https://github.com/apache/beam/pull/11108/commits/5ebae2cd735bc8b93af6d8ec6132c3f06e256fae

----------------------------------------------------------------
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

Reply via email to