You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case of timeout, the distributed code currently raises a generic OSError (search for: raise OSError).
There are many lines that contain except OSError or variations thereof (search for regex: except .*OSError.
In some cases, we have checks (in production, not in the unit tests) on the string repr of the caught OSError to figure out if they are actually timeouts.
As a general design rule, it pays to be as specific as possible when raising and catching exceptions.
I don't recommend changing the timeouts to TimeoutError, because:
a. TimeoutError is not a subclass of OSError, so many current except blocks would stop working and one would need to chase them all down
b. it creates confusion with asyncio.TimeoutError.
I would suggest instead creating a new exception class ConnectionTimeoutError(OSError): pass
We should search for all except .*OSError and investigate, case by case, if it's possible to narrow it down to some of its subclasses (except (CommClosedError, ConnectionTimeoutError, RPCClosed) hopefully?)
This of course carries the risk of getting overzealous and accidentally resuscitating some old infrequent crash caused by other subclasses of OSError (unhandled failures from the socket module?).
Activity
fjetter commentedon Jun 29, 2021
FYI #4741
[-]EnvironmentError and IOError[/-][+]Narrow down `except OSError` blocks[/+]crusaderky commentedon Jun 30, 2021
Rescoped and rewrote description downstream of #4741 and #5003
OSError tweaks (#5003)