forked from lightningnetwork/lnd
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
Dependency cycle causing shutdown deadlock #97
Comments
matheusd
added a commit
to matheusd/dcrlnd
that referenced
this issue
Apr 17, 2020
See issue decred#97 for details.
matheusd
added a commit
to matheusd/dcrlnd
that referenced
this issue
Jun 2, 2020
See issue decred#97 for details.
matheusd
added a commit
to matheusd/dcrlnd
that referenced
this issue
Jun 2, 2020
See issue decred#97 for details.
matheusd
added a commit
to matheusd/dcrlnd
that referenced
this issue
Jun 19, 2020
See issue decred#97 for details.
matheusd
added a commit
to matheusd/dcrlnd
that referenced
this issue
Jun 19, 2020
See issue decred#97 for details.
matheusd
added a commit
to matheusd/dcrlnd
that referenced
this issue
Jul 7, 2020
See issue decred#97 for details.
matheusd
added a commit
to matheusd/dcrlnd
that referenced
this issue
Jul 8, 2020
See issue decred#97 for details.
matheusd
added a commit
to matheusd/dcrlnd
that referenced
this issue
Jul 8, 2020
See issue decred#97 for details.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sub-systems are shutdown concurrently:
dcrlnd/server.go
Line 1411 in 2975978
However there's interdependency between them. Specifically,
chanRouter
depends on the currentcc.chainView
instance but calls toGetBlock
might block indefinitely until thechainView
is called to stop.One situation where this is manifested is on the
garbage_collect_link_nodes
itest where a channel is opened between Alice and Dave and immediately after that Bob and Carol are restarted. It might be the case that Bob (or Carol) is in the middle of aGetBlock()
call and on theremotewallet
implementation that cashes out to a loop that is only returned from once the wallet is told to shutdown. But that only happens later in the server shutdown routine, so the wallet shutdown deadlocks.Currently this is solved in the itest with a dummy
Sleep
call but ideally this should be solved either by performing subsystem shutdown in parallel (so that the wallet shutting down bubbles up an error to chanRouter) or by requiring thechainView
methods to accept acontext
parameter, so that the caller itself can cancel them.The text was updated successfully, but these errors were encountered: