GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(node): Local variables handle error by timfish · Pull Request #13827 · getsentry/sentry-javascript

Conversation

@timfish

@timfish timfish commented Sep 29, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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
All reactions
  • 🎉 1 reaction
@timfish
fix(node): Local variables handle error
ccccfdd
@github-actions

github-actions Bot commented Sep 29, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bruno-dasilva

bruno-dasilva commented Sep 29, 2024

Copy link
Copy Markdown

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bruno-dasilva

bruno-dasilva commented Sep 29, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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:
Screen Shot 2024-09-29 at 8 19 11 AM

timfish reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bruno-dasilva bruno-dasilva mentioned this pull request Sep 29, 2024
NestJS TypeScript sentry issues not showing local variables for errors #13768
Closed
3 tasks done
@bruno-dasilva

bruno-dasilva commented Sep 29, 2024

Copy link
Copy Markdown

As a final FYI i tested a try/catch in the worker and it has fixed the worker dying in my testing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@timfish

timfish commented Sep 29, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

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
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

timfish added 3 commits September 30, 2024 13:15
@timfish
Change logic and remove memory leak test
9418b68
@timfish
Merge branch 'develop' into timfish/fix/local-variables-crash
f2fa688
@timfish
Merge branch 'develop' into timfish/fix/local-variables-crash
52469e9
AbhiPrasad
AbhiPrasad approved these changes Oct 2, 2024
View reviewed changes
@AbhiPrasad
AbhiPrasad merged commit 0d42ae8 into develop Oct 4, 2024
@AbhiPrasad
AbhiPrasad deleted the timfish/fix/local-variables-crash branch October 4, 2024 19:30
@timfish

timfish commented Oct 10, 2024

Copy link
Copy Markdown
Collaborator Author

The fix for this has been released in v8.34.0!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chiragjn

chiragjn commented Oct 18, 2024

Copy link
Copy Markdown

I just tried it out, weirdly objects of a class end up null :/
image

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@timfish

timfish commented Oct 18, 2024

Copy link
Copy Markdown
Collaborator Author

@chiragjn this looks unrelated to this issue so can you open a new issue with a reproduction?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@q1blue q1blue mentioned this pull request Oct 31, 2024
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.34.0 https-quantumblockchainai-atlassian-net/ossinsight#968
Open
@bagulm123 bagulm123 mentioned this pull request Nov 2, 2024
[Snyk] Upgrade @sentry/react from 8.22.0 to 8.34.0 bagulm123/komiser#29
Open
This was referenced Nov 2, 2024
[Snyk] Upgrade @sentry/browser from 8.33.1 to 8.34.0 mong/mongts#3389
Closed
[Snyk] Upgrade @sentry/react from 8.33.1 to 8.34.0 mong/mongts#3390
Closed
@kenn7575 kenn7575 mentioned this pull request Nov 3, 2024
[Snyk] Upgrade @sentry/sveltekit from 8.33.1 to 8.34.0 kenn7575/kenni-kollemorten-v2#81
Closed
@mbreadmachine mbreadmachine mentioned this pull request Nov 5, 2024
[Snyk] Upgrade @sentry/react from 8.28.0 to 8.34.0 mbreadmachine/arany-d-osztaly-weboldal#60
Merged
@q1blue q1blue mentioned this pull request Nov 11, 2024
[Snyk] Upgrade @sentry/react from 7.16.0 to 8.35.0 https-quantumblockchainai-atlassian-net/ossinsight#983
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@AbhiPrasad AbhiPrasad AbhiPrasad approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

4 participants

@timfish @bruno-dasilva @chiragjn @AbhiPrasad
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.