mxm commented on a change in pull request #11084: [BEAM-9474] Improve
robustness of BundleFactory and ProcessEnvironment
URL: https://github.com/apache/beam/pull/11084#discussion_r390483041
##########
File path:
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DefaultJobBundleFactory.java
##########
@@ -352,20 +407,18 @@ public RemoteBundle getBundle(
// The blocking queue of caches for serving multiple bundles
concurrently.
currentCache = availableCaches.take();
client = currentCache.getUnchecked(executableStage.getEnvironment());
- client.ref();
currentClient = preparedClients.get(client);
if (currentClient == null) {
// we are using this client for the first time
preparedClients.put(client, currentClient = prepare(client,
executableStage));
// cleanup any expired clients
- preparedClients.keySet().removeIf(c -> c.bundleRefCount.get() == 0);
+ preparedClients.keySet().removeIf(c -> c.bundleRefCount.get() <= 0);
Review comment:
I prefer including the entire range whenever I write such checks. Just a way
to guard against future changes where we might countdown after the value has
reached zero.
----------------------------------------------------------------
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