Skip to content

[3.15] gh-153005: Use a monotonic clock for concurrent.interpreters Queue timeouts (GH-154156) - #155967

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-b94b9c8-3.15
Open

[3.15] gh-153005: Use a monotonic clock for concurrent.interpreters Queue timeouts (GH-154156)#155967
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-b94b9c8-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Queue.get() and Queue.put() computed their timeout deadline from
time.time(), the wall clock. If the system clock was stepped (NTP, a
manual change) while a call was blocked, the timeout could over- or
under-wait. queue.Queue uses time.monotonic() for the same reason.

Compute the deadline and check it against time.monotonic() instead.
(cherry picked from commit b94b9c8)

Co-authored-by: Vyron Vasileiadis hi@fedonman.com

…eue timeouts (pythonGH-154156)

Queue.get() and Queue.put() computed their timeout deadline from
time.time(), the wall clock. If the system clock was stepped (NTP, a
manual change) while a call was blocked, the timeout could over- or
under-wait. queue.Queue uses time.monotonic() for the same reason.

Compute the deadline and check it against time.monotonic() instead.
(cherry picked from commit b94b9c8886a987a324a677b5fda5bef27f15cb14)

Co-authored-by: Vyron Vasileiadis <hi@fedonman.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants