siad does not cleanly close each module
Currently, signal handling is done in api/server.go
, here : https://github.com/NebulousLabs/Sia/blob/master/api/server.go#L84. Siad calls this function and expects it to block, returning when Serve() has completed. Therefore, server.Serve() returning means the program ends. Because of this, srv.Close progresses to srv.wg.Wait()
, and the program ends, failing to safely close each module.