ConnectionManager finally block is blocking and can receive exceptions #3572
Labels
connection-manager
Issues / PRs related to connection-manager
io-sim-discovered
Issue discovered by IOSim
ConnectionManager
finally
block is blocking and can receive exceptions interrupting important clean connection shutdown.ConnectionManager
's finally block deals with the closing of connections andcancel
ling their connection handlers. It does so by sequentially traversing theConnectionManager
state, updating and tracing the connections's state and performing a blockingcancel
on the connection handler thread.When working on the connection manager timeout enforcing issue (#3330) it was noticed that one thing that should happen is that if the
InboundGovernor
dies, theConnectionManager
needs to die as well, otherwise there can be connection in a given state for longer than expected since theInboundGovernor
can no longer track theinboundIdleTimeout
. UsinglinkOnly
one can makeAsyncCancelled
exceptions propagate toConnectionManager
thread, however this also means that theConnectionManager
's exception handler might receive sporadic exceptions interrupting the exception handler and abort connection cleanup midway making them timeout later than desired.To mitigate this one should wrap the block around
uninterruptibleMask_
The text was updated successfully, but these errors were encountered: