bosagora / agora

POC Node implementation for CoinNet
https://bosagora.io
MIT License
37 stars 22 forks source link

SIGTERM is not stopping program during node startup #3209

Closed mkykadir closed 11 months ago

mkykadir commented 2 years ago

During runNode if we have long running operation, such as replaying from storage, node cannot be stopped with SIGTERM.

When a node lost state.db, it starts replaying blocks from storage. During this, Ctrl + C is not handled properly and node cannot be stopped. Main cause is, replaying starts during ctor of the node, thus listeners.node cannot be assigned and is null. Following check fails to stop the node.

https://github.com/bosagora/agora/blob/dd2491c711296fcb561ec5b90900a7a3c7c194d1/source/agora/node/main.d#L245

mkykadir commented 2 years ago

Updated issue details, since its not just related with block replaying but during runNode in general.

mkykadir commented 2 years ago

Related with #3158