-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[#32222] Actually maintain the heap invariant for timers. #33270
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
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
|
Fix two Java tests, but now a Python test is failing. Curious. |
|
R: @robertwb for the update to the test. Adjusted the timer firing to be just within the window in question instead of just outside of it. |
| # based on ordering and trigger firing timing. | ||
| self.assertEqual(sorted(sum((list(b) for b in actual), [])), elements) | ||
| self.assertEqual(max(len(list(buffer)) for buffer in actual), buffer_size) | ||
| self.assertEqual( |
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.
Added the actual output to the asserts help with debugging, hence the line reflows.
| ss.pendingByKeys[string(e.keyBytes)] = dnt | ||
| } | ||
| dnt.elements.Push(e) | ||
| heap.Push(&dnt.elements, e) |
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.
This fixes maintaining the heap invariant.
robertwb
left a comment
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.
Test fix LGTM.
|
Thanks! I've made a note to log a clear warning/error when timers are set beyond their window + AllowedLateness. Once that's in, it'll be clearer whether I can just hard fail pipelines when it happens with a hopefully clear error message. |
testEventTimeTimerOrderingWithCreate was hanging due to timers being fired in incorrect order. The issue was that the heap variant wasn't being maintained on inserting timers for a key. This would cause timers to fire out of event time ordering. In particular, the "GC" timer would fire first (because it was set first), instead of the earlier firing "append" timer.
This incorrect ordering was also what caused testTwoTimersSettingEachOtherWithCreateAsInputUnbounded to fail.
Fixes #32222.
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.mdwith 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.