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
Right now Pathfinder does not implement proper graceful shutdown. We do have some code in our main loop to stop on TERM and INT signals -- but we don't actually gracefully stop all tasks. This leads to some nasty side-effects, like the SQLite DB file being left "open" with the SHM / WAL file still present. (And possible more in the future: Cairo Native for example relies on temporary files which are not properly cleaned up unless we explicitly make sure that our global class cache is properly destroyed.)
The tokio documentation has a page on implementing graceful shutdown. We should look into how we could use CancellationToken and TaskTracker to make sure that we gracefully exit on receiving a TERM or INT signal. This involves making sure that all our "main" tasks (sync, RPC and P2P) exit gracefully including all their sub-tasks being cleaned up as well.
We should probably also add a grace period on shutdown: we should still exit after ~10s (should be configurable) even if not all tasks were properly stopped.
The text was updated successfully, but these errors were encountered:
Right now Pathfinder does not implement proper graceful shutdown. We do have some code in our main loop to stop on TERM and INT signals -- but we don't actually gracefully stop all tasks. This leads to some nasty side-effects, like the SQLite DB file being left "open" with the SHM / WAL file still present. (And possible more in the future: Cairo Native for example relies on temporary files which are not properly cleaned up unless we explicitly make sure that our global class cache is properly destroyed.)
The tokio documentation has a page on implementing graceful shutdown. We should look into how we could use
CancellationToken
andTaskTracker
to make sure that we gracefully exit on receiving a TERM or INT signal. This involves making sure that all our "main" tasks (sync, RPC and P2P) exit gracefully including all their sub-tasks being cleaned up as well.We should probably also add a grace period on shutdown: we should still exit after ~10s (should be configurable) even if not all tasks were properly stopped.
The text was updated successfully, but these errors were encountered: