Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectionManager finally block is blocking and can receive exceptions #3572

Closed
bolt12 opened this issue Jan 13, 2022 · 0 comments · Fixed by #3532
Closed

ConnectionManager finally block is blocking and can receive exceptions #3572

bolt12 opened this issue Jan 13, 2022 · 0 comments · Fixed by #3532
Assignees
Labels
connection-manager Issues / PRs related to connection-manager io-sim-discovered Issue discovered by IOSim

Comments

@bolt12
Copy link
Contributor

bolt12 commented Jan 13, 2022

ConnectionManager finally block is blocking and can receive exceptions interrupting important clean connection shutdown.

ConnectionManager's finally block deals with the closing of connections and cancelling their connection handlers. It does so by sequentially traversing the ConnectionManager state, updating and tracing the connections's state and performing a blocking cancel 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, the ConnectionManager needs to die as well, otherwise there can be connection in a given state for longer than expected since the InboundGovernor can no longer track the inboundIdleTimeout . Using linkOnly one can make AsyncCancelled exceptions propagate to ConnectionManager thread, however this also means that the ConnectionManager'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_

@bolt12 bolt12 added networking connection-manager Issues / PRs related to connection-manager io-sim-discovered Issue discovered by IOSim labels Jan 13, 2022
@bolt12 bolt12 linked a pull request Jan 13, 2022 that will close this issue
@bolt12 bolt12 self-assigned this Jan 13, 2022
@coot coot moved this to In Progress in Ouroboros Network Feb 2, 2022
@iohk-bors iohk-bors bot closed this as completed in #3532 Feb 3, 2022
Repository owner moved this from In Progress to Done in Ouroboros Network Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connection-manager Issues / PRs related to connection-manager io-sim-discovered Issue discovered by IOSim
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant