Commit a965cc4
Fix macOS ENOTCONN detection in handle_write peer-disconnect check
macOS raises OSError(57, "Socket is not connected") (ENOTCONN) when
writing to a peer-disconnected socket. Unlike BrokenPipeError or
ConnectionResetError, this is a plain OSError — not a ConnectionError
subclass — so it was not caught by the isinstance(err, ConnectionError)
check. Add errno-based detection for ENOTCONN, ESHUTDOWN, ECONNRESET,
and ECONNABORTED to handle these platform-specific disconnect errors
cleanly instead of defuncting the connection.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8b84da7 commit a965cc4
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
235 | 242 | | |
236 | | - | |
| 243 | + | |
| 244 | + | |
237 | 245 | | |
238 | 246 | | |
239 | 247 | | |
| |||
0 commit comments