Commit 16570ce
g97iulio1609
fix: handle ClosedResourceError when logging errors to disconnected clients
Wrap send_log_message() in _handle_message's exception handler with a
try/except for ClosedResourceError and BrokenResourceError. When a client
disconnects during request processing, the server catches the stream
exception but then crashes trying to send the error log back through the
already-closed write stream.
Closes #20641 parent 62575ed commit 16570ce
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
425 | 428 | | |
426 | 429 | | |
427 | 430 | | |
| |||
0 commit comments