[#32222] Actually maintain the heap invariant for timers.#33270
[#32222] Actually maintain the heap invariant for timers.#33270lostluck merged 5 commits intoapache:masterfrom
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.
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.
This fixes maintaining the heap invariant.
|
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.