Skip to content

fix calling POOL.update_counts() when no gil-refs feature#4200

Merged
adamreichold merged 8 commits intoPyO3:mainfrom
davidhewitt:fix-pool-assume
Jun 2, 2024
Merged

fix calling POOL.update_counts() when no gil-refs feature#4200
adamreichold merged 8 commits intoPyO3:mainfrom
davidhewitt:fix-pool-assume

Conversation

@davidhewitt
Copy link
Copy Markdown
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
Copy Markdown
Member

alex commented May 21, 2024 via email

@davidhewitt
Copy link
Copy Markdown
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
Copy Markdown
Member

alex commented May 21, 2024 via email

@davidhewitt
Copy link
Copy Markdown
Member Author

Test failure is legit, will fix.

Copy link
Copy Markdown
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 enabled auto-merge June 2, 2024 09:59
@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 enabled auto-merge June 2, 2024 10:51
@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
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.

3 participants