You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The syncGraphWithChain function in routing/router.go cannot be stopped by a shutdown signal while it's running. The function is ment to be able to exit early by closing the quit channel here:
But as the syncGraphWithChain function is synchronously called in the Start function, the Stop function which closes the quit channel, can never be triggered until the syncing is complete. The only call-sites for the Stop function can only ever happen after the ChannelRouterStart function has fully executed:
ViktorTigerstrom
changed the title
[bug]: ChannelRouter cannot be shutdown while the syncGraphWithChain is running.
[bug]: ChannelRouter cannot be shutdown while the syncGraphWithChain function is running.
May 3, 2024
Awesome, thanks! I just want to clarify though, that the ChannelRouterStart function will not return while the syncGraphWithChain function is running. So only adding the Stop function for the ChannelRouter to the cleanUp func in the server, before the Start function is executed won't really change the behaviour detailed in this issue unless I'm missing something?
Background
The
syncGraphWithChain
function inrouting/router.go
cannot be stopped by a shutdown signal while it's running. The function is ment to be able to exit early by closing the quit channel here:lnd/routing/router.go
Line 854 in fb632bb
But as the
syncGraphWithChain
function is synchronously called in theStart
function, theStop
function which closes the quit channel, can never be triggered until the syncing is complete. The only call-sites for theStop
function can only ever happen after theChannelRouter
Start
function has fully executed:lnd/server.go
Line 2020 in fb632bb
lnd/lnd.go
Line 681 in fb632bb
Steps to reproduce
To reproduce the issue, you can add some simple code to the beginning of the
syncGraphWithChain
function like the following:Then try to shutdown
lnd
with a shutdown signal while the code above is executing.Expected behaviour
The
syncGraphWithChain
function should exit early by a shutdown signal.Actual behaviour
lnd
will only shutdown after thesyncGraphWithChain
and theStart
function has finished their execution.The text was updated successfully, but these errors were encountered: