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

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

                Author: ASF GitHub Bot
            Created on: 17/May/19 14:27
            Start Date: 17/May/19 14:27
    Worklog Time Spent: 10m 
      Work Description: mxm commented on pull request #8599: [BEAM-7348] 
Support environment expiration
URL: https://github.com/apache/beam/pull/8599#discussion_r285147129
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DefaultJobBundleFactory.java
 ##########
 @@ -282,6 +298,84 @@ public void close() throws Exception {
     }
   }
 
+  /** A {@link StageBundleFactory} that supports environment expiration. */
+  private class SmarterStageBundleFactory implements StageBundleFactory {
+
+    private final ExecutableStage executableStage;
+    private SimpleStageBundleFactory currentFactory;
+
+    private SmarterStageBundleFactory(ExecutableStage executableStage) {
+      this.executableStage = executableStage;
+      WrappedSdkHarnessClient wrappedClient =
+          environmentCache.getUnchecked(executableStage.getEnvironment());
+      currentFactory = createBundleFactory(wrappedClient);
+    }
+
+    private SimpleStageBundleFactory 
createBundleFactory(WrappedSdkHarnessClient wrappedClient) {
+      ExecutableProcessBundleDescriptor processBundleDescriptor;
+      try {
+        processBundleDescriptor =
+            ProcessBundleDescriptors.fromExecutableStage(
+                stageIdGenerator.getId(),
+                executableStage,
+                
wrappedClient.getServerInfo().getDataServer().getApiServiceDescriptor(),
+                
wrappedClient.getServerInfo().getStateServer().getApiServiceDescriptor());
+      } catch (IOException e) {
+        throw new RuntimeException(e);
 
 Review comment:
   ```suggestion
           throw new RuntimeException("Failed to create 
ProcessBundleDescriptor.", e);
   ```
 
----------------------------------------------------------------
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: 244046)
    Time Spent: 50m  (was: 40m)

> Option to expire SDK worker environments
> ----------------------------------------
>
>                 Key: BEAM-7348
>                 URL: https://issues.apache.org/jira/browse/BEAM-7348
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-core
>    Affects Versions: 2.12.0
>            Reporter: Thomas Weise
>            Assignee: Thomas Weise
>            Priority: Major
>              Labels: portability, portability-flink
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> We discovered that Python SDK workers are susceptible to memory leaks that 
> are quite hard to identify and/or fix. This becomes an issue in streaming 
> pipelines, where the workers run "forever". It would be good if the user has 
> an option to recycle the workers when there is no other practical way to 
> address (slow) resource leaks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to