tangata-manu icon indicating copy to clipboard operation
tangata-manu copied to clipboard

Exit status 1 on sync thread fail

Open vsubhuman opened this issue 5 years ago • 2 comments

When sync thread is interrupted with an error - the whole thing should crash instead of just hanging on the server thread.

Right now on error we just do nothing here: https://github.com/Emurgo/tangata-manu/blob/master/src/server.js#L58

Should be clear process.exit(1); after the logging.

vsubhuman avatar Sep 08 '19 18:09 vsubhuman

It seems we have a related issue on the cron scheduler:

[2019-11-11T13:22:10.785Z] ERROR: yoroi-importer/170 on 8d023c80a08a:
    Scheduler.startAsync exited with an error: TypeError: Cannot read property 'slot' of null
        at CronScheduler._callee6$ (/usr/src/app/src/entities/cron.js:168:178)
        at tryCatch (/usr/src/app/node_modules/regenerator-runtime/runtime.js:62:40)
        at Generator.invoke [as _invoke] (/usr/src/app/node_modules/regenerator-runtime/runtime.js:288:22)
        at Generator.prototype.(anonymous function) [as next] (/usr/src/app/node_modules/regenerator-runtime/runtime.js:114:21)
        at asyncGeneratorStep (/usr/src/app/src/entities/cron.js:16:939)
        at _next (/usr/src/app/src/entities/cron.js:16:1277)
        at process._tickCallback (internal/process/next_tick.js:68:7)
[nodemon] app crashed - waiting for file changes before starting...

rcmorano avatar Nov 11 '19 13:11 rcmorano

And another one when a timeout is received while connecting to postgresql:

[2019-11-20T05:22:57.327Z]  INFO: yoroi-importer/177 on 8d023c80a08a: checkTip: checking for new blocks...
[2019-11-20T05:23:02.334Z] ERROR: yoroi-importer/177 on 8d023c80a08a:
    Scheduler.startAsync exited with an error: Error: Connection terminated due to connection timeout
        at Connection.con.once (/usr/src/app/node_modules/pg/lib/client.js:200:9)
        at Object.onceWrapper (events.js:277:13)
        at Connection.emit (events.js:189:13)
        at Connection.EventEmitter.emit (domain.js:441:20)
        at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:76:10)
        at Socket.emit (events.js:189:13)
        at Socket.EventEmitter.emit (domain.js:441:20)
        at TCP._handle.close (net.js:597:12)
[nodemon] app crashed - waiting for file changes before starting...

cc @crchemist-ip

rcmorano avatar Nov 21 '19 16:11 rcmorano