Currently, when the sending ILP connector sends a packet and it expires, we end up crashing the node process. This is because the packet expiry check is done via setTimeout, with the callback throwing an error that causes an uncaughtException. This leads to a SIGTERM, and the app crashes/exits.
The node process does not crash/exit if a packet from the sending connector expires.
Additional context
setTimeout callbacks are treated in a separate call stack as part of the node event loop, this means they are handled outside of the code where they were registered.
Bug Report
Currently, when the sending ILP connector sends a packet and it expires, we end up crashing the node process. This is because the packet expiry check is done via
setTimeout
, with the callback throwing an error that causes anuncaughtException
. This leads to aSIGTERM
, and the app crashes/exits.https://github.com/interledger/rafiki/blob/cd3d89373e4f24fddbd1da5347e4ec7e44d8b61e/packages/backend/src/payment-method/ilp/connector/core/middleware/expire.ts#L10-L26
Expected behavior
The node process does not crash/exit if a packet from the sending connector expires.
Additional context
setTimeout
callbacks are treated in a separate call stack as part of the node event loop, this means they are handled outside of the code where they were registered.