-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Unhandled errors in ANR worker causes app to pause indefinitely #11147
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
Comments
With
|
I also only get user details ( This applies with or without Example of a regular event where user ID, app memory, start time etc. all captured normally: 3eb53f70c4974c6bb21f41e46c5c1f47 Both of these were triggered with the same setup - just a setTimeout which either threw an Error or sat in a blocking loop for 2s to trigger the ANR. |
Another one: |
@delaneyb thanks for the detailed report! We will take a look and hopefully address al your feedback. @timfish Would you mind taking a look when you find the time? I think the |
I've split this into multiple issues:
|
CTX variable released with https://github.com/getsentry/sentry-javascript/releases/tag/7.108.0 |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
@sentry/integrations
SDK Version
7.107.0 (48b8169)
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
ctx
defined in the main node runtimectx
not defined in your own code, then causing more than 1 anr event I believe also triggers the issue because thenctx
has already been defined)This is due to multiple issues with the worker.ts script:
sentry-javascript/packages/node/src/integrations/anr/worker.ts
Lines 171 to 192 in fa1621c
Errors in evaluation of the
const ctx = __SENTRY__...
expression designed to capture the data for the trace ID are not properly handled.ctx
is already defined, the expression throwsIdentifier 'ctx' has already been declared
. Here is the value ofparam
coming into the callback when that occurs:When an error like this occurs in evaluating the expression, this leads to
TypeError: Cannot read properties of undefined (reading 'split')
since traceId is not actually a string but rather undefinedThis error gets silently dropped, and the program remains paused and stuck, since the following
Debugger.resume
never gets calledExpected Result
The ANR event should have been created and reported, and my process should have been resumed and continued running as normal.
The
Debugger.resume
should have been sent back to the runtime FIRST to make sure that it always resumes, and:const ctx = __SENTRY__.hub.getScope...
expression andsession.post('Runtime.evaluate'
Should be at least surfaced with a console.warn or something.
Actual Result
The text was updated successfully, but these errors were encountered: