-
Notifications
You must be signed in to change notification settings - Fork 6
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
Handle signals on separate thread #876
Comments
This introduces another way to signal an event outside of the existing priority queue mechanism for a special case (shutting down). We may want to consider a more unified approach. |
I missed the discussion on this, so maybe I'm not understanding the issue. What I'm suggesting we do for this issue is to have a seperate thread (just use the thread we are already using on startup) who's sole job is to call |
In addition, the user experience is so bad with the current implementation, I would argue this is a |
There were multiple main discussion topics that I recall:
After a 1/2 hour discussion, it was decided that we needed to talk about this more with you (@heifner) present. Might very well be that the fix you suggest solves the immediate issue and should be implemented now, even if a more comprehensive solution is implemented later. PS: Anyone, feel free to correct or add to what I recollected above. |
@heifner should we close this issue? |
Currently during application startup
application_base::startup
,startup_thread
is used to handle signals until allplugin->startup()
has completed. This allows for example, ctrl-c to interrupt replay of the blocklog duringchain_plugin
startup.Once startup is complete, the signal handling is moved to the main thread. This means that a ctrl-c or SIGTERM is not processed until the
application_base::exec()
callsio_serv.poll()
on the main thread. If the main thread is busy, for example applying a large range of blocks during syncing, then shutdown has to wait until the current task completes. It requires the main thread can callpoll()
to process the signal to set theis_quitting
atomic flag.Instead we could continue to use a seperate thread for signal processing (except for SIGHUP which we want on the main thread since it resets all the loggers). This thread then can immediately set the
is_quitting
flag allowing the application to immediately exit.The text was updated successfully, but these errors were encountered: