mxm 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_r392583334
##########
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:
Thanks for spotting this!
----------------------------------------------------------------
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