Repository navigation
fix(v10/node-core): Register the Vercel SIGTERM listener once - #25826
Open
sentry-junior[bot] wants to merge 2 commits into
Open
sentry-junior[bot] wants to merge 2 commits into
sentry-junior[bot] wants to merge 2 commits into
Conversation
Both init() paths added a SIGTERM listener on every call when VERCEL is set, so repeated init() leaked one listener per call and flushed stale clients. Register a single shared listener that flushes the latest client, matching #25146 on v11. Fixes #25825 Co-Authored-By: Burak Yigit Kaya <126780+BYK@users.noreply.github.com>
Contributor
size-limit report 📦
|
BYK
marked this pull request as ready for review
October 28, 2026 15:05
BYK
requested review from
msonnb and
stephanie-anderson
and removed request for
a team
October 28, 2026 15:05
msonnb
approved these changes
Oct 28, 2026
Lms24
reviewed
Oct 28, 2026
Lms24
left a comment
Member
There was a problem hiding this comment.
Do we need this on v10 for a concrete reason? We decided to stop porting back every fix to v10, given v11 has been around for a while now and is stabilized. We can still backport it but there should be a reason to do so.
Member
No concrete reason if we stopped supporting v10. I remember hearing that we'll be supporting v10 a bit more and that's why I got this opened. Feel free to close, I won't be offended :D |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On Vercel, both
@sentry/node-coreinit paths (default and/light) add a newSIGTERMlistener on everyinit()call, and nothing ever removes it. Processes that callinit()repeatedly therefore leak one listener per call, hitMaxListenersExceededWarningafter 10, and flush every stale client on shutdown. The Sentry CLI hits this in library mode, since it re-inits per command during bundler-plugin source-map uploads (getsentry/toolkit#1692).This takes the approach #25146 took on v11: keep one listener that flushes the latest client. That PR has a guard that registers only once. Here the helper instead checks whether its stable handler is already attached. That way, code that removes the listener (the existing tests do) gets a fresh one on the next
init(). Both init paths share the helper, so mixing default and lightinit()also leaves a single listener.This is v10-only. On
develop,node-corewas merged into@sentry/nodeand #25146 already covers it.Fixes #25825
via @BYK.
--
View Junior Session [Sentry]