Repository navigation
Cancel the eventlet Timer's entry so repeating timers stop - #11161
Open
AliMuhammadAslam wants to merge 1 commit into
Open
AliMuhammadAslam wants to merge 1 commit into
AliMuhammadAslam wants to merge 1 commit into
Conversation
9 of 19 tasks
GreenThread.cancel() is a no-op once the greenthread has started, so cancelling a repeating timer after its first tick left the entry running. Mark the entry canceled on cancel() and skip canceled entries.
AliMuhammadAslam
force-pushed
the
fix/eventlet-timer-cancel
branch
from
November 24, 2026 12:15
b1409a0 to
f1dbc57
Compare
This branch has not been deployed
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.
Description
Fixes #11160
GreenThread.cancel()does nothing once the greenthread has started, so a timer fromcall_repeatedly()could not be cancelled after its first tick: the entry was never marked canceled and kept rescheduling itself.clear()had the same problem while a callback was running, and an entry canceled withentry.cancel()still ran. In a worker, every broker reconnect left anotherHeart/Gossiptimer running.The timer's greenthreads now cancel their entry when they are cancelled, and canceled entries are skipped when they come due.
The new tests run against the real eventlet hub. 6 of them fail on
main. Note that CI only installs eventlet on Python < 3.10, so they are skipped on newer versions.