After turning on TCP keepalive probes in a streams based service I
maintain, I get quite a few irrelevant logs from the `_fatal_error()`
handler in `selecter_events.py`.
Using keepalive probes will result in a `TimeoutError` from the socket
module which is perfectly normal. My application catches these
TimeoutError exceptions and does the things it wants to do in the case of
dead peer detection. I could do without all the spurious logs from the
asyncio core though.
My question is if we should add TimeoutError to the tuple of ignored
exceptions defined in `base_events.py`? Here is the context for that
set...
# Exceptions which must not call the exception handler in fatal error
# methods (_fatal_error())
_FATAL_ERROR_IGNORE = (BrokenPipeError,
ConnectionResetError, ConnectionAbortedError)
And here is what the logs look like...
[2016-11-02 13:18:00,009] [pid:30475:MainThread] [asyncio] [ERROR] Fatal
read error on socket transport
protocol: <asyncio.streams.StreamReaderProtocol object at 0x7fa3a8773b00>
transport: <_SelectorSocketTransport fd=720 read=polling write=<idle,
bufsize=0>>
Traceback (most recent call last)
1. File "/home/mayfield/project/asyncio/asyncio/selector_events.py", line
723, in _read_ready
data = self._sock.recv(self.max_size)
TimeoutError: [Errno 110] Connection timed out