-
Notifications
You must be signed in to change notification settings - Fork 740
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
fix calling POOL.update_counts() when no gil-refs
feature
#4200
Merged
Conversation
This file contains 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
I believe we were still calling it, but just not when a Gil guard was
created with the GIL already held. Maybe that was wrong though
…On Tue, May 21, 2024, 5:02 PM David Hewitt ***@***.***> wrote:
While testing #4178 <#4178> I noticed
that it looks like we accidentally stopped calling POOL.update_counts
without the gil-refs feature enabled (probably in #4188
<#4188>).
This rearranges code a little bit so that calling GILGuard::assume and
GILGuard::acquire always call POOL.update_counts, and adds a test for
this.
cc @alex <https://github.com/alex>
------------------------------
You can view, comment on, or merge this pull request online at:
#4200
Commit Summary
- e519b3b
<e519b3b>
fix calling POOL.update_counts() when no `gil-refs` feature
File Changes
(2 files <https://github.com/PyO3/pyo3/pull/4200/files>)
- *M* src/gil.rs
<https://github.com/PyO3/pyo3/pull/4200/files#diff-3caef7ca643353676abf32d8e1a44b7d21f44dbaae39bc92cdd2e35c5c5ecaf4>
(92)
- *M* src/marker.rs
<https://github.com/PyO3/pyo3/pull/4200/files#diff-b36e5dab91de9ae329fe692f3b0db5aec5fbd720042069742b401c7169cc184e>
(4)
Patch Links:
- https://github.com/PyO3/pyo3/pull/4200.patch
- https://github.com/PyO3/pyo3/pull/4200.diff
—
Reply to this email directly, view it on GitHub
<#4200>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBDCVWMB7ZJ74YGKPPLZDOY5HAVCNFSM6AAAAABICLTO52VHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYDSMJQHA4TGOA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Indeed, and in |
Right. I hadn't intended to change that behavior, so this makes sense.
…On Tue, May 21, 2024, 5:10 PM David Hewitt ***@***.***> wrote:
Indeed, and in trampoline.rs we call GILGuard::assume and so we stopped
ever calling it on entry into #[pyfunction]s.
—
Reply to this email directly, view it on GitHub
<#4200 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBCEE7ITJ6RZNKA6IHDZDOZ3VAVCNFSM6AAAAABICLTO52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRTGQ2DOMRSG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Test failure is legit, will fix. |
adamreichold
approved these changes
Jun 2, 2024
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.
I took the liberty to deduplicate the construction of GILGuard::Assumed
a bit. Otherwise LGTM.
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jun 2, 2024
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.
While testing #4178 I noticed that it looks like we accidentally stopped calling
POOL.update_counts
without thegil-refs
feature enabled (probably in #4188).This rearranges code a little bit so that calling
GILGuard::assume
andGILGuard::acquire
always callPOOL.update_counts
, and adds a test for this.cc @alex