Skip to content

gh-154431: Use existing runtime->audit_hooks.mutex instead of a new one#154494

Open
sobolevn wants to merge 1 commit into
python:mainfrom
sobolevn:issue-154431-2
Open

gh-154431: Use existing runtime->audit_hooks.mutex instead of a new one#154494
sobolevn wants to merge 1 commit into
python:mainfrom
sobolevn:issue-154431-2

Conversation

@sobolevn

@sobolevn sobolevn commented Jul 22, 2026

Copy link
Copy Markdown
Member

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will just increase contention in sys.addaudithook, won't it?

@sobolevn

Copy link
Copy Markdown
Member Author

I don't think that we actually concurrenly add hooks with both PySys_AddAuditHook and sys.audithook, so realistically - it should not matter.

@sobolevn sobolevn added skip news needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 22, 2026
@ZeroIntensity

Copy link
Copy Markdown
Member

Agreed, but why make this change at all? We're just increasing pressure on a lock for no reason. PyMutex is just a single byte; due to alignment, I would be surprised if you see any change in memory overhead.

@sobolevn

Copy link
Copy Markdown
Member Author

Because we can't backport the fix with interpreter state changed due to ABI change.
And we want to fix the data race on 3.14 :(

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

Labels

awaiting core review needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants