-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[Prism] Refactor stageState to a behavior interface to reduce branch combinatorics #34132
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
Conversation
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
Alas, when I synced before starting this, my local builds stopped working, so I'm unable to dig into what I messed up in the migration (likely in the startEventTimeBundle handling). I'll be on a trip for a week, so I'll revisit after that. |
Hi @lostluck, friendly reminder to revisit this PR. Thanks. |
Damon helped unblock my local testing against the Java suite. The Java build wasn't working after I synced, so I needed the reminder that beam's Gradle Clean doesn't work properly, and sometimes you just need to manually remove all the build folders: |
assign set of reviewers |
Assigning reviewers. If you would like to opt out of this review, comment R: @jrmccluskey for label go. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - gave this a quick pass since it's mostly re-arranging existing code, the end result seems far more readable
…combinatorics (apache#34132) * [Prism] Refactor stageState to a behavior interface to reduce branch combinatorics * Revert on demand pending change. * revert attempt at lock avoidance, causes hangs. --------- Co-authored-by: lostluck <13907733+lostluck@users.noreply.github.com>
…combinatorics (apache#34132) * [Prism] Refactor stageState to a behavior interface to reduce branch combinatorics * Revert on demand pending change. * revert attempt at lock avoidance, causes hangs. --------- Co-authored-by: lostluck <13907733+lostluck@users.noreply.github.com>
A basic no-behavior change refactoring to split the different stage kinds up more cleanly into the 3 types: ordinary, Stateful, and aggregation.
While their differences don't come up everywhere, they in particular affect when building bundles, and adding pending input elements to their stages.
The hope of this change is to reduce the combinatorics complexity parts of prism were suffering under, depending on which kind of stage was being handled. This leads to some duplication between Stateful and aggregation stages, but having clear handling of their differences should make up for it.
This is a minimal change. Not every potential portion is moved over right now, just those that had additional branching paths due to the old Stateful or aggregate booleans. Future changes should move handling of the pending elements stacks into similar methods instead of simply checking both.
This needed to work a change that was made to ElementManager.FailBundle which tried to avoid an issue with a deadlock in one of the test stream tests (testMultiStage). The deadlock problem became much worse for reasons not evident to the split, and it appears it was due to never performing the cleanup that Fail bundle performs.
Part of prism work: #29650 and was originally mentioned in #33881
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.