zebra
zebra copied to clipboard
Return errors from `Connection` methods to the `Client`
Motivation
We're seeing "failed servers must set their error slot" panics when Zebra is overloaded.
This panic is caused by the design of the Client
connection code. Currently, the Client
tasks share an ErrorSlot
mutex, which must be updated before they exit.
This ticket stops using the error slot in the Connection
task.
Designs
Instead of using the error slot, Client
tasks should exit and return an error to the client instance.
The Client
should exit when any task errors or stops.
We could try something like this: (click for details)
Replace Connection.error_slot
with returning a PeerError
:
- when there is an unrecoverable error, return an error from the current
Connection
method - propagate those errors up to
Connection::run
-
break
from the run loop, callshutdown
, then return the error - check the error via the
JoinHandle
in theClient
Related Work
This is part of:
- #3263
We're lowering the priority of network issues at the moment.