dogecoinfoundation / gigawallet

GigaWallet is the backend for your Dogecoin Business.
https://gigawallet.dogecoin.org
MIT License
56 stars 11 forks source link

Gigawallet terminates itself if node stops reponding, after some time. #108

Closed qlpqlp closed 1 year ago

qlpqlp commented 1 year ago

Wen the node is not responding, in my case It was being restarted with the zapwallettxes=1, GigaWallet server terminates itself instead of waiting for the node to resume

2023/09/03 13:20:18 TipChaser: falling back to getbestblockhash 2023/09/03 13:20:31 TipChaser: core RPC request failed: getbestblockhash 2023/09/03 13:22:02 TipChaser: falling back to getbestblockhash 2023/09/03 13:22:13 TipChaser: core RPC request failed: getbestblockhash 2023/09/03 13:23:46 TipChaser: falling back to getbestblockhash 2023/09/03 13:23:46 TipChaser: core RPC request failed: getbestblockhash 2023/09/03 13:25:17 TipChaser: falling back to getbestblockhash 2023/09/03 13:25:37 TipChaser: core RPC request failed: getbestblockhash 2023/09/03 13:27:08 TipChaser: falling back to getbestblockhash 2023/09/03 13:27:24 TipChaser: core RPC request failed: getbestblockhash 2023/09/03 13:28:54 TipChaser: falling back to getbestblockhash Caught terminated signal, shutting downRequesting shutdown: MessageBus Requesting shutdown: Logger ./events.log Requesting shutdown: Callback sender for: https://shibeship.com/callbacks/ Requesting shutdown: NewBalanceKeeper Requesting shutdown: InvoiceStamper Requesting shutdown: PayMaster Requesting shutdown: TipChaser Requesting shutdown: ChainFollower Requesting shutdown: ZMQ Listener Requesting shutdown: Payment API Shutdown complete: PayMaster Shutdown complete: MessageBus Shutdown complete: Logger ./events.log Shutdown complete: Callback sender for: https://shibeship.com/callbacks/ Shutdown complete: InvoiceStamper 2023/09/03 13:28:54 ChainFollower: received command Shutdown complete: ChainFollower Shutdown complete: Payment API 2023/09/03 13:28:54 BalanceKeeper: panic received: shutdown 2023/09/03 13:28:55 TipChaser: core RPC request failed: getbestblockhash Shutdown complete: TipChaser Shutdown complete: ZMQ Listener Timeout exeeded waiting for services to stop, shutting down

raffecat commented 1 year ago

Hmm, I need to investigate this, usually it will wait.

Caught terminated signal, shutting down

raffecat commented 1 year ago

Shutdown was caused by the following code:

// This hooks SIGTERM and SIGINT and will shut down the Conductor
// if one is detected.
func HookSignals() func(*Conductor) {
    return func(c *Conductor) {
        sigCh := make(chan os.Signal, 1)
        signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGINT)
        go func() {
            for {
                select {
                case sig := <-sigCh: // sigterm/sigint caught
                    c.logf("Caught %v signal, shutting down", sig)
                    c.Stop()
                    continue
                case <-c.shutdown: // service is closing down..
                    return
                }
            }
        }()
    }
}

Which logged the message Caught terminated signal, shutting down

This means the process received a SIGTERM signal, usually caused by pressing Ctrl+C, but also by closing a terminal that runs the program, or shutting down the machine.