skynetservices/skynet-archive

Shutdown() is called twice when signaled

erikstmartin opened this issue · 0 comments

This is due to the fact of Shutdown() being called by the goroutine watching signals, as well as the stack unwinding and the defer to shutdown in main() being run as recommended.

Both of these places Shutdown() is called solve different purposes, so our best option might be to make Shutdown a no-op after it's been called once. So that it doesn't do any duplicate work and doesn't trigger callbacks on the implementors side multiple times.