ConnectionManager Timeouts not enforced within reasonable bounds #3553
Labels
connection-manager
Issues / PRs related to connection-manager
io-sim-discovered
Issue discovered by IOSim
test-failure
a test failure
From working on #3532 :
Looking at the logs I see the timer being registered and an
EventTimerExpired
for it appears at the correct time. It then proceeds triggeringunregisterInboundConnection
correctly at the correct time. ButunregisterInboundConnection
blocks on theConnectionManager
stateVar
.A bunch of time later it gets an
AsyncCancelled
exception and the cleanup function fromforkConnecionHandler
runs, which also blocks on thestateVar
.For timeout enforcement sake we should already unblocked ages ago, but there are multiple threads blocked on
stateVar
and the one that unblocks first is none of the two we needed. It appears that the threads that hold the lock block waiting on timers too and due to an unfortunate order of events we end up going way beyond the deadline.The problem seems to be just concurrency and lengthy locks. From looking at the code this is due to the use of
readTMVar
onunregisterInboundConnection
, which is blocking.NOTE: There are other instances of this failure for other transitions all with the same root cause.
The text was updated successfully, but these errors were encountered: