Skip to content

fix: drop lock earlier; was held across send_event().await unnecessarily#18178

Merged
bolinfest merged 1 commit intomainfrom
pr18178
Apr 16, 2026
Merged

fix: drop lock earlier; was held across send_event().await unnecessarily#18178
bolinfest merged 1 commit intomainfrom
pr18178

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 16, 2026

This was flagged by the Codex Security tool: the state lock was held longer than necessary, which included being held across an async call, increasing the potential for deadlock.

While this was flagged by the Codex Security tool, I will look into enabling https://rust-lang.github.io/rust-clippy/stable/index.html#await_holding_lock in a follow-up PR (though unfortunately, that Clippy rule claims it reports false positives when drop() is used to drop a guard instead of using the end of block scope to drop). Though I can't seem to find a Clippy rule that checks for opportunities to drop a guard as soon as it is no longer referenced, in general.

@bolinfest bolinfest enabled auto-merge (squash) April 16, 2026 19:22
@bolinfest bolinfest disabled auto-merge April 16, 2026 19:22
@bolinfest bolinfest enabled auto-merge (squash) April 16, 2026 19:24
@bolinfest bolinfest merged commit dfff8a7 into main Apr 16, 2026
34 of 36 checks passed
@bolinfest bolinfest deleted the pr18178 branch April 16, 2026 19:29
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants