fix calling POOL.update_counts() when no gil-refs feature#4200
Merged
adamreichold merged 8 commits intoPyO3:mainfrom Jun 2, 2024
Merged
fix calling POOL.update_counts() when no gil-refs feature#4200adamreichold merged 8 commits intoPyO3:mainfrom
gil-refs feature#4200adamreichold merged 8 commits intoPyO3:mainfrom
Conversation
Member
|
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:
***@***.***>
|
Member
Author
|
Indeed, and in |
Member
|
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:
***@***.***>
|
Member
Author
|
Test failure is legit, will fix. |
adamreichold
approved these changes
Jun 2, 2024
Member
adamreichold
left a comment
There was a problem hiding this comment.
I took the liberty to deduplicate the construction of GILGuard::Assumed a bit. Otherwise LGTM.
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.
While testing #4178 I noticed that it looks like we accidentally stopped calling
POOL.update_countswithout thegil-refsfeature enabled (probably in #4188).This rearranges code a little bit so that calling
GILGuard::assumeandGILGuard::acquirealways callPOOL.update_counts, and adds a test for this.cc @alex