-
Notifications
You must be signed in to change notification settings - Fork 98
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
Postgres unhandled promise rejection #1319
Comments
Hi, richardscarrott! Thank you so much for the bug report. And sorry for the delay in getting to look into it. You said you have a reduced test case that can reproduce this. Would you be willing to share it? |
Hi @michaelsafyan Looks like I said I've not got a reduced test case unfortunately. We were using |
Hi @michaelsafyan! I just spent the last 3 days debugging this issue. It never occurred to me that tracing could be the issue, so I had to chip down our application bit by bit until the culprit was found :) As a result, I have a small reproducible example to share too: https://github.com/vincentvanderweele/cloud-trace-unhandled-promise We run Node with the recommended flag |
@michaelsafyan do you have any updates on this? I personally think that the priority of this bug should be reassessed, given the reproduction scenario. Basically, this tracing library cannot be used together with Postgres unless you suppress unhandled rejection promises on application level. We had to disable Postgres tracing altogether to stop our server processes from crashing. |
Hi @vincentvanderweele. Sorry for the long silence on this issue, and thanks for putting together a minimal repro. We're taking a look to see if there's a better way for this library to handle the rejected promise. |
Hi @vincentvanderweele. In your repro, you patch the trace agent to make it work on pg v8. Unfortunately, pg v8 isn't actually supported. As described in #1272 (comment), please consider using @opentelemetry/instrumentation-pg instead. |
I spoke too soon - this still happens under Node v12 + PG v7. Reopening. |
This ensures that asynchronous work done by patching gets awaited properly. In particular, it prevents unhandled promise rejections. Fixes googleapis#1319.
This ensures that asynchronous work done by patching gets awaited properly. In particular, it prevents unhandled promise rejections. Fixes googleapis#1319.
This ensures that asynchronous work done by patching gets awaited properly. In particular, it prevents unhandled promise rejections. Fixes googleapis#1319.
This ensures that asynchronous work done by patching gets awaited properly. In particular, it prevents unhandled promise rejections. Fixes googleapis#1319.
This ensures that asynchronous work done by patching gets awaited properly. In particular, it prevents unhandled promise rejections. Fixes googleapis#1319.
This ensures that asynchronous work done by patching gets awaited properly. In particular, it prevents unhandled promise rejections. Fixes googleapis#1319.
This ensures that asynchronous work done by patching gets awaited properly. In particular, it prevents unhandled promise rejections. Fixes #1319.
We're getting unhandled promise rejections from the
pg
module (via postgraphile) only when the trace agent is enabled:Environment details
System:
Binaries:
Packages:
Steps to reproduce
I've not got a reduced test case but in our express server using postgraphile a DB constraint violation error on insert results in an unhandled promise rejection. Removing the trace agent prevents this from occurring so I'm guessing the promise is forked by the trace agent but not handled.
The text was updated successfully, but these errors were encountered: