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

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

                Author: ASF GitHub Bot
            Created on: 24/Apr/18 22:23
            Start Date: 24/Apr/18 22:23
    Worklog Time Spent: 10m 
      Work Description: jkff commented on a change in pull request #5216: 
[BEAM-4166] Invoke @Setup in FnApiDoFnRunner
URL: https://github.com/apache/beam/pull/5216#discussion_r183898182
 
 

 ##########
 File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java
 ##########
 @@ -384,6 +384,7 @@
     this.windowingStrategy = windowingStrategy;
     this.doFnSignature = DoFnSignatures.signatureForDoFn(doFn);
     this.doFnInvoker = DoFnInvokers.invokerFor(doFn);
+    this.doFnInvoker.invokeSetup();
 
 Review comment:
   I think this is a reasonable place to invoke it - it's almost the same as 
[in 
DoFnLifecycleManager](https://github.com/apache/beam/blob/2bcc60622e0d039d7a12266fc72e89bacb94d104/runners/direct-java/src/main/java/org/apache/beam/runners/direct/DoFnLifecycleManager.java#L102).
 In all cases currently, setup is invoked very shortly after deserializing the 
DoFn; same here.
   
   I'm not sure what you mean by serializing and sending off DoFnRunner? Setup 
typically initializes transient state of the DoFn that can not be serialized, 
e.g. network connections and such - i.e. the expected lifecycle is "deserialize 
a copy of what the pipeline says, call setup, run bundles, call teardown".

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 94824)
    Time Spent: 0.5h  (was: 20m)

> FnApiDoFnRunner doesn't invoke setup/teardown
> ---------------------------------------------
>
>                 Key: BEAM-4166
>                 URL: https://issues.apache.org/jira/browse/BEAM-4166
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-harness
>            Reporter: Eugene Kirpichov
>            Assignee: Eugene Kirpichov
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> And we apparently lack test coverage for that - one would think that 
> ValidatesRunner tests would check lifecycle.



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

Reply via email to