Message297643
I propose to ignore ECONNRESET in socket.close() and ENOTCONN and WSAEINVAL on socket.shutdown(). If we see more failures later, we can extend these lists.
asyncore also ignores ENOTCONN on socket.close(), but I don't trust this module at this point: it seems like asyncore also handles pipes, not only socket.socket.
Errors seen on buildbots:
* ECONNRESET (ConnectionResetError) on socket.close()
* ENOTCONN and WSAEINVAL on socket.shutdown() -- that's why I ignored these errors in poplib and imaplib
The Python standard library already ignores some errors on socket.shutdown() and socket.close() depending on the module:
* poplib, imaplib: ignore ENOTCONN and WSAEINVAL on socket.shutdown()
* asyncore: ignore ENOTCONN and EBADF on socket.close(). asyncore ignores much more errors on functions doing read, write or close (depending on the received event): ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE, EBADF. In a function doing read+close, it says "winsock sometimes raises ENOTCONN".
* asyncio: don't log a fatal error for EPIPE, ESHUTDOWN, ECONNRESET, ECONNABORTED errors. Lib/asyncio/base_events.py:
# Exceptions which must not call the exception handler in fatal error
# methods (_fatal_error())
_FATAL_ERROR_IGNORE = (BrokenPipeError, ConnectionResetError, ConnectionAbortedError)
Mapping of exceptions to error codes:
* BrokenPipeError: EPIPE, ESHUTDOWN
* ConnectionResetError: ECONNRESET
* ConnectionAbortedError: ECONNABORTED |
|
Date |
User |
Action |
Args |
2017-07-04 11:45:36 | vstinner | set | recipients:
+ vstinner, janssen, pitrou, christian.heimes, alex, martin.panter, dstufft |
2017-07-04 11:45:36 | vstinner | set | messageid: <1499168736.32.0.541920449984.issue30319@psf.upfronthosting.co.za> |
2017-07-04 11:45:36 | vstinner | link | issue30319 messages |
2017-07-04 11:45:36 | vstinner | create | |
|