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

make unregister functions non-blocking #3526

Merged
merged 6 commits into from
Dec 6, 2021

Conversation

coot
Copy link
Contributor

@coot coot commented Dec 6, 2021

  • connection-manager: cancel threads using throwTo
  • connection-manager: added transition tracer
  • connection-manager-test: removed prop_connectionManagerSimulation
  • connection-manager: enforce WaitTime timeout
  • connection-manager: change how masking of the cleanup function is done.
  • server-test: comment why 'splitConns' is correct
  • connection-manager: demotedToColdRemote

@coot coot requested a review from karknu as a code owner December 6, 2021 09:17
@coot coot added networking connection-manager Issues / PRs related to connection-manager testing labels Dec 6, 2021
@coot coot requested a review from bolt12 December 6, 2021 09:17
Copy link
Contributor

@bolt12 bolt12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! just a few comments!

Also fix connection manager simulation.  The simulation environment
should not kill the connection thread with an asynchronous exception
when the connection handler throws an exception.
The generators are tricky to maintain, since they need to predict the
timeline of events to make sure that socket imposed semantics is
preserved (e.g. there's no inbound connection while an inbound
connection is active).  On the other side, the server tests are mature
enough to replace the property (the `prop_connectionManagerSimulation`
predates simulated snocket).
Make sure that the wait time timeouts takes 'cmTimeWaitTimeout' seconds,
even if an async exception is delivered during it.  At the same time, it
must not block async exceptions, to avoid `unregisterInboundConnection`
(or `unregisterOutboundConnection`) being blocked for its duration.
* start the thread with masked exceptions (`asyncWithUnmask`, does not
  masks exceptions!)
* remove not needed `uninterruptibleMask_`, since the exceptions are
  already uninterruptibly masked.
`demotedToColdRemote` can be executed when the connection is in
`TerminatedState` (while pruning: see
https://github.com/input-output-hk/ouroboros-network/runs/4408176265?check_suite_focus=true).
In this test, while `AsyncException` propagates through mux threads, we
managed to be notified about a last terminating mini-protocol, which
triggered 'WaitIdleRemote' before 'MuxFinished' in the inbound governor.

As a fix, we return now 'TerminatedConnection' and let the inbound
governor remove the peer from its state without waiting on the mux
notification.
@coot coot force-pushed the coot/cm-fix-blocking-unregister branch from 3c7d323 to f5e14cc Compare December 6, 2021 10:54
@coot
Copy link
Contributor Author

coot commented Dec 6, 2021

I removed the connection-manager: added transition tracer, to avoid modification of traces, this currently causes problems for merging the new tracing system.

@bolt12
Copy link
Contributor

bolt12 commented Dec 6, 2021

Maybe this will fix my timeout enforced tests

@bolt12 bolt12 self-requested a review December 6, 2021 12:03
@coot
Copy link
Contributor Author

coot commented Dec 6, 2021

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 6, 2021

@iohk-bors iohk-bors bot merged commit eda2779 into master Dec 6, 2021
@iohk-bors iohk-bors bot deleted the coot/cm-fix-blocking-unregister branch December 6, 2021 19:01
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 testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants