[ 
https://issues.apache.org/jira/browse/BEAM-9490?focusedWorklogId=402312&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-402312
 ]

ASF GitHub Bot logged work on BEAM-9490:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Mar/20 16:46
            Start Date: 12/Mar/20 16:46
    Worklog Time Spent: 10m 
      Work Description: mxm commented on pull request #11108: [BEAM-9490] Guard 
referencing for environment expiration via a lock
URL: https://github.com/apache/beam/pull/11108#discussion_r391752678
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DefaultJobBundleFactory.java
 ##########
 @@ -192,6 +202,28 @@ public static DefaultJobBundleFactory create(
     ImmutableList.Builder<LoadingCache<Environment, WrappedSdkHarnessClient>> 
caches =
         ImmutableList.builder();
     for (int i = 0; i < count; i++) {
+      final Lock refLock = environmentCacheLocks.get(i);
+      builder = builder.removalListener(
+          notification -> {
+            WrappedSdkHarnessClient client = (WrappedSdkHarnessClient) 
notification.getValue();
 
 Review comment:
   This is resolved now.
 
----------------------------------------------------------------
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: 402312)
    Time Spent: 40m  (was: 0.5h)

> Environment may be cleaned up prematurely when using environment expiration
> ---------------------------------------------------------------------------
>
>                 Key: BEAM-9490
>                 URL: https://issues.apache.org/jira/browse/BEAM-9490
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Maximilian Michels
>            Assignee: Maximilian Michels
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> When environment expiration is configured, environments are removed from a 
> cache map after some amount of time. This cache map may be accessed by 
> multiple ExecutableStage transforms in parallel. During environment 
> expiration there is a small time window which allows for an environment to 
> still being used while another transform removes, dereferences, and closes 
> the environment. This is not expected behavior.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to