[
https://issues.apache.org/jira/browse/BEAM-9474?focusedWorklogId=401742&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-401742
]
ASF GitHub Bot logged work on BEAM-9474:
----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Mar/20 20:07
Start Date: 11/Mar/20 20:07
Worklog Time Spent: 10m
Work Description: tweise commented on pull request #11084: [BEAM-9474]
Improve robustness of BundleFactory and ProcessEnvironment
URL: https://github.com/apache/beam/pull/11084#discussion_r391235877
##########
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();
Review comment:
> It's not true that a later `ref()` introduces a bug for
`preparedClients.keySet().removeIf(c -> c.bundleRefCount.get() <= 0);` because
the refcount will be >0, otherwise we wouldn't be able to retrieve the client
from the cache.
Cache and environment are shared between executable stages. So the refcount
can become 0 with concurrent eviction and release. That actually raises the
question if these 2 statements should be atomic.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 401742)
Time Spent: 6h 10m (was: 6h)
> Environment cleanup is not robust enough and may leak resources
> ---------------------------------------------------------------
>
> Key: BEAM-9474
> URL: https://issues.apache.org/jira/browse/BEAM-9474
> Project: Beam
> Issue Type: Bug
> Components: java-fn-execution
> Reporter: Maximilian Michels
> Assignee: Maximilian Michels
> Priority: Major
> Time Spent: 6h 10m
> Remaining Estimate: 0h
>
> The cleanup code in {{DefaultJobBundleFactory}} and its {{RemoteEnvironment}}
> s may leak resources. This is especially a concern when the execution engines
> reuses the same JVM or underlying machines for multiple runs of a pipeline.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)