Repository navigation
Honor stop and pause called from an EventGenerator callback - #3874
Merged
quaquel merged 1 commit intoSep 21, 2026
Merged
Conversation
|
Performance benchmarks:
|
quaquel
approved these changes
Sep 21, 2026
Member
|
Thanks for catching this! |
This was referenced Oct 6, 2026
1 task done
EwoutH
pushed a commit
that referenced
this pull request
Oct 28, 2026
(cherry picked from commit 6df1f43)
53 of 65 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3873.
EventGenerator._execute_and_rescheduleran the callback and then scheduled the next event without re-checking whether the callback had stopped or paused the generator. Sogen.stop()orgen.pause()called from inside the generator's own callback was only partly honored: a next event was still scheduled, andnext_scheduled_timekept reporting a time on a stopped generator.Repro on main:
Fix: after running the callback, return early if the generator is no longer active or is paused, before scheduling the next event.
Added tests for stopping and pausing from within the callback.
Verified locally: the event tests pass and ruff check and format are clean.