Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejection in sendPing #265

Closed
acolytec3 opened this issue Sep 22, 2023 · 1 comment
Closed

UnhandledPromiseRejection in sendPing #265

acolytec3 opened this issue Sep 22, 2023 · 1 comment

Comments

@acolytec3
Copy link
Contributor

We've recently started noticing some unhandled promise rejections that are being thrown by discv5.sendPing inside of Ultralight. The stack trace for the error looks like below:

    at callback (file:///home/jim/development/ultralight/node_modules/@chainsafe/discv5/lib/service/service.js:354:33)
    at SessionService.rpcFailure (file:///home/jim/development/ultralight/node_modules/@chainsafe/discv5/lib/service/service.js:811:13)
    at SessionService.emit (node:events:514:28)
    at SessionService.failRequest (file:///home/jim/development/ultralight/node_modules/@chainsafe/discv5/lib/session/service.js:650:14)
    at SessionService.handleRequestTimeout (file:///home/jim/development/ultralight/node_modules/@chainsafe/discv5/lib/session/service.js:615:18)
    at TimeoutMap.onTimeout (file:///home/jim/development/ultralight/node_modules/@chainsafe/discv5/lib/session/service.js:98:84)
    at Timeout.<anonymous> (file:///home/jim/development/ultralight/node_modules/@chainsafe/discv5/lib/util/timeoutMap.js:25:22)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

and the debugger links the source of the error to this promise rejection in sendPing.

I looked through the calls to sendPing in the discv5 codebase and it doesn't look like any of them are directly wrapped in try/catch blocks so not sure where I need to look to see why this isn't being handled since it looks like it's a basic session timeout issue (which shouldn't be a critical requiring a consuming application to handle it.

Since we never call discv5.sendPing directly inside Ultralight, I'm trying to determine if this is some new issue that has cropped up with discv5 or if it's something Ultralight did (or didn't) do with regard to properly guarding network calls with our discv5 client.

Any suggestions?

For our part, we're temporarily employing a process.on('uncaughtException... handler to keep Ultralight from crashing for now since as best I can tell this comes from trying to ping unreachable nodes and the rejections just not being handled properly.

@philknows
Copy link
Member

Resolved by #284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants