Commit 63fbd7e
committed
fix: bypass PrintBuffer in launch() to prevent RLock deadlock
PrintBuffer.flush() writes directly to sys.__stdout__ while holding
an RLock. When the platform pauses reading stdout, flush() blocks on
the pipe and the lock is never released. Every other thread that calls
logger.info() then blocks waiting for the same RLock, causing a
process-wide deadlock.
Removing the 'with PRINT_BUFFER:' wrapper means print() and logging
go directly to stdout/stderr without the shared lock, allowing the
stdout writer thread to be the only bottleneck on the pipe.
Co-Authored-By: unknown <>1 parent 059fd36 commit 63fbd7e
1 file changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
380 | 383 | | |
381 | 384 | | |
382 | 385 | | |
| |||
0 commit comments