Skip to content

[6.40] [python] Ensure GIL is held during CPython API call#22408

Open
root-project-bot wants to merge 1 commit into
root-project:v6-40-00-patchesfrom
root-project-bot:BP_6.40_pull_22402
Open

[6.40] [python] Ensure GIL is held during CPython API call#22408
root-project-bot wants to merge 1 commit into
root-project:v6-40-00-patchesfrom
root-project-bot:BP_6.40_pull_22402

Conversation

@root-project-bot
Copy link
Copy Markdown

Backport of #22402, requested by @vepadulano.

ROOT's CPython extension defines a custom error handler that tries to use Python standard warnings when possible. In such cases, the CPython API is called and thus the GIL must be held. If the calling Python function had previously released the GIL it will result in trouble. This is the case for the TH1.Fit method which has been changed to always releasing the GIL, under the assumption that everything happening during the call happens in C++, but that's not true. This commit proposes to restore the GIL for the call to the CPython API to raise the warning.

(cherry picked from commit 56ce5ff)
@github-actions
Copy link
Copy Markdown

Test Results

    21 files      21 suites   3d 10h 16m 51s ⏱️
 3 856 tests  3 509 ✅   0 💤 347 ❌
73 257 runs  71 784 ✅ 792 💤 681 ❌

For more details on these failures, see this check.

Results for commit 0bb5456.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants