Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All Python DirectRunners call setup/teardown on DoFns #11547

Merged
merged 2 commits into from
Apr 28, 2020

Conversation

pabloem
Copy link
Member

@pabloem pabloem commented Apr 28, 2020

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@kennknowles kennknowles changed the title All DirectRunners call setup/teardown on DoFns All Python DirectRunners call setup/teardown on DoFns Apr 28, 2020
@@ -874,6 +875,7 @@ def process_element(self, element):

def finish_bundle(self):
self.runner.finish()
self.runner.teardown()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the runner re-instantiate the DoFn for each bundle? That is the contract of teardown. The DoFn instance can never be touched again. (I'm mostly trying to learn more about the Python SDK and runners)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does re-instantiate for each bundle. I remember we had a jira somewhere to re-use dofn instances for more than one bundle, we never implemented that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to check this, but in Python, generally, we do not reuse Dofns, so they're recreated for each bundle. Let me confirm..

@pabloem
Copy link
Member Author

pabloem commented Apr 28, 2020

Run Python PreCommit

2 similar comments
@pabloem
Copy link
Member Author

pabloem commented Apr 28, 2020

Run Python PreCommit

@pabloem
Copy link
Member Author

pabloem commented Apr 28, 2020

Run Python PreCommit

@pabloem pabloem merged commit d15e29d into apache:master Apr 28, 2020
@pabloem pabloem deleted the stptdnfn branch April 28, 2020 21:10
@aaltay
Copy link
Member

aaltay commented Apr 29, 2020

Do you know if this will fix https://issues.apache.org/jira/browse/BEAM-7885 ?

@pabloem
Copy link
Member Author

pabloem commented Apr 29, 2020 via email

bntnam pushed a commit to PolideaInternal/beam that referenced this pull request May 5, 2020
* All DirectRunners call setup/teardown on DoFns

* fix formatter
yirutang pushed a commit to yirutang/beam that referenced this pull request Jul 23, 2020
* All DirectRunners call setup/teardown on DoFns

* fix formatter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants