You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by GitBox <gi...@apache.org> on 2020/03/13 19:04:28 UTC

[GitHub] [beam] tweise commented on a change in pull request #11108: [BEAM-9490] Guard referencing for environment expiration via a lock

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:
users@infra.apache.org


With regards,
Apache Git Services