hubble-contracts icon indicating copy to clipboard operation
hubble-contracts copied to clipboard

Crash/exit Hubble Node process and other scripts/entrypoints on UnhandledPromiseRejections

Open jacque006 opened this issue 3 years ago • 1 comments

Problem

When an unhandled promise rejection occurs in the Hubble Node process (and likely any of our scripts/other entry points), a warning is logged out but does not prevent the process from continuing, such as in https://github.com/thehubbleproject/hubble-contracts/issues/612 . This can lead to suppression of critical bugs/issues.

Solution

Set NodeJS --unhandled-rejections=strict to exit node process when an unhandled promise rejection occurs. We should do this in the Docker image CMD line, and the numerous spots where ts-node is called. Ideally this can be done in package.json, tsconfig.json, or some other config file.

jacque006 avatar Jun 23 '21 23:06 jacque006

Consider also crashing the node after n failed ETH provider re-connection attempts, or a duration of failed re-connections https://github.com/thehubbleproject/hubble-contracts/blob/master/ts/client/node.ts#L43-L45

jacque006 avatar Jul 13 '21 15:07 jacque006