AleoNet / snarkOS

A Decentralized Operating System for ZK Applications
http://snarkos.org
Apache License 2.0
4.1k stars 2.57k forks source link

Handle SIGTERM the same as SIGINT for triggering snarkos shutdown #3274

Closed kyle-u410 closed 1 month ago

kyle-u410 commented 1 month ago

🚀 Feature

SIGTERM is an alias for SIGINT.

Motivation

Currently SIGINT is used to trigger shutdown with SIGTERM triggering immediate exit. This is non-standard. SIGTERM is the default termination signal used by most tools. The result of using SIGTERM is likely ledger corruption.

I have helped a number of validators (including ourselves) understand to modify tooling to use SIGINT. We can avoid this by keeping SIGINT handling the same and adding duplicate handling for SIGTERM.

Implementation

Add SIGTERM handlers which are the same as SIGINT.

niklaslong commented 1 month ago

Thanks for opening a feature request! We already handle INT, TERM, HUP and QUIT in the same way. Perhaps I am misunderstanding what you have in mind?

kyle-u410 commented 1 month ago

Hey great. It looks like https://github.com/AleoNet/snarkOS/pull/3102/files already implemented this.

Sorry for the duplicate. It seem that by switching to SIGINT this helped some validators in Canary, but based on when the code was merged and the patch itself, there must have been another cause.

I will switch our tooling overback to SIGTERM and confirm expected behavior.