Skip to content
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
merged 8 commits into from
Jun 2, 2024

Conversation

davidhewitt
Copy link
Member

While testing #4178 I noticed that it looks like we accidentally stopped calling POOL.update_counts without the gil-refs feature enabled (probably in #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

@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label May 21, 2024
@alex
Copy link
Contributor

alex commented May 21, 2024 via email

@davidhewitt
Copy link
Member Author

Indeed, and in trampoline.rs we call GILGuard::assume and so we stopped ever calling it on entry into #[pyfunction]s.

@alex
Copy link
Contributor

alex commented May 21, 2024 via email

@davidhewitt
Copy link
Member Author

Test failure is legit, will fix.

Copy link
Member

@adamreichold adamreichold left a 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.

@adamreichold adamreichold added this pull request to the merge queue Jun 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 2, 2024
@adamreichold adamreichold added this pull request to the merge queue Jun 2, 2024
Merged via the queue into PyO3:main with commit 88b6f23 Jun 2, 2024
40 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants