Fix asyncio.Event race conditions in idle processors

Move event.clear() from finally block to success path in
IdleFrameProcessor and UserIdleProcessor._idle_task_handler().
The finally block unconditionally cleared signals set during
async timeout callbacks, causing false-positive idle detection.

Closes #3402
This commit is contained in:
iamjr15
2026-02-21 20:15:07 +05:30
committed by Aleix Conchillo Flaqué
parent 988c08a5b6
commit 565349d332
3 changed files with 106 additions and 2 deletions

1
changelog/3796.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed `IdleFrameProcessor` where `asyncio.Event` was unconditionally cleared in a `finally` block instead of only on the success path.