-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-135698: Fix Cross-interpreter Queue.full() With Negative/Default max_size #135724
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
gh-135698: Fix Cross-interpreter Queue.full() With Negative/Default max_size #135724
Conversation
Thanks @ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…ault max_size (pythongh-135724) We weren't handling non-positive maxsize values (including the default) properly in Queue.full(). This change fixes that and adjusts an associated assert. (cherry picked from commit c5ea8e8) Co-authored-by: Eric Snow <[email protected]>
GH-135775 is a backport of this pull request to the 3.14 branch. |
Sorry, @ericsnowcurrently, I could not cleanly backport this to
|
…fault max_size (gh-135775) We weren't handling non-positive maxsize values (including the default) properly in Queue.full(). This change fixes that and adjusts an associated assert. (cherry picked from commit c5ea8e8, AKA gh-135724) Co-authored-by: Eric Snow <[email protected]>
…ault max_size (pythongh-135724) We weren't handling non-positive maxsize values (including the default) properly in Queue.full(). This change fixes that and adjusts an associated assert.
*p_is_full = queue->items.maxsize > 0 | ||
? queue->items.count == queue->items.maxsize | ||
: 0; |
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.
Why not write this as queue->items.count >= queue->items.maxsize
?
We weren't handling non-positive
maxsize
values (including the default) properly inQueue.full()
. This change fixes that and adjusts an associated assert._interpqueuesmodule
due to queue being created with negativemaxsize
#135698