GeezerVison is showing github.com — fix(node): Local variables handle error by timfish · Pull Request #13827 · getsentry/sentry-javascript
Conversation
timfish
commented
Sep 29, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Ref #13768
Runtime.releaseObject can throw. I've reworked it to simplify and so that errors are caught.
After a lot of testing, I've removed the memory leak test. I've tested this PR extensively on Node v20 + v22 and while memory usage does peak at ~350MB, it doesn't get above that after 15 minute of 1k errors per second. Memory usage varies from 150-300MB but I've concluded it's not actually leaking.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
bruno-dasilva reacted with hooray emoji
size-limit report 📦
| Path |
Size |
% Change |
Change |
| @sentry/browser |
22.63 KB |
- |
- |
| @sentry/browser - with treeshaking flags |
21.42 KB |
- |
- |
| @sentry/browser (incl. Tracing) |
34.86 KB |
- |
- |
| @sentry/browser (incl. Tracing, Replay) |
71.36 KB |
- |
- |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags |
61.79 KB |
- |
- |
| @sentry/browser (incl. Tracing, Replay with Canvas) |
75.72 KB |
- |
- |
| @sentry/browser (incl. Tracing, Replay, Feedback) |
88.49 KB |
- |
- |
| @sentry/browser (incl. Tracing, Replay, Feedback, metrics) |
90.36 KB |
- |
- |
| @sentry/browser (incl. metrics) |
26.91 KB |
- |
- |
| @sentry/browser (incl. Feedback) |
39.77 KB |
- |
- |
| @sentry/browser (incl. sendFeedback) |
27.29 KB |
- |
- |
| @sentry/browser (incl. FeedbackAsync) |
32.08 KB |
- |
- |
| @sentry/react |
25.38 KB |
- |
- |
| @sentry/react (incl. Tracing) |
37.84 KB |
- |
- |
| @sentry/vue |
26.8 KB |
- |
- |
| @sentry/vue (incl. Tracing) |
36.75 KB |
- |
- |
| @sentry/svelte |
22.76 KB |
- |
- |
| CDN Bundle |
23.94 KB |
- |
- |
| CDN Bundle (incl. Tracing) |
36.63 KB |
- |
- |
| CDN Bundle (incl. Tracing, Replay) |
71.13 KB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback) |
76.44 KB |
- |
- |
| CDN Bundle - uncompressed |
70.14 KB |
- |
- |
| CDN Bundle (incl. Tracing) - uncompressed |
108.6 KB |
- |
- |
| CDN Bundle (incl. Tracing, Replay) - uncompressed |
220.49 KB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed |
233.71 KB |
- |
- |
| @sentry/nextjs (client) |
37.8 KB |
- |
- |
| @sentry/sveltekit (client) |
35.43 KB |
- |
- |
| @sentry/node |
125.09 KB |
-0.04% |
-40 B 🔽 |
| @sentry/node - without tracing |
93.54 KB |
-0.04% |
-30 B 🔽 |
| @sentry/aws-serverless |
103.24 KB |
-0.04% |
-39 B 🔽 |
View base workflow run
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
hah. I was just testing the new implementation and ran into this exact problem, was about to open a gh issue.
@timfish is it worth implementing some kind of heartbeat on the worker so we can detect (and log) when it's dead?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
And btw, a minimal reproducible example would likely be to throw an exception but immediately throw it away (+ let it be GC'd?) without doing a Sentry.captureException(). Perhaps that could be added as a test.
I believe what's happening is exceptions that get caught and thrown away before the 1s releaseObject timer runs result in this lovely inspector error:

|
timfish reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
As a final FYI i tested a try/catch in the worker and it has fixed the worker dying in my testing.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
timfish
commented
Sep 29, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
so we can detect (and log) when it's dead?
If you have logging enabled via debug: true we log if the worker has errors or exits.
|
bruno-dasilva reacted with eyes emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The fix for this has been released in v8.34.0!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I just tried it out, weirdly objects of a class end up null :/

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@chiragjn this looks unrelated to this issue so can you open a new issue with a reproduction?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 2, 2024
Reviewers
1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|