You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[v10] @sentry/node-core init() adds a Vercel SIGTERM listener per call #25825
@sentry/node-core 10.x (checked on the v10 branch at 10.77.1 and in published 10.63.0 and 10.75.2). Affects both init() from @sentry/node-core and @sentry/node-core/light.
Description
When process.env.VERCEL is set, both _init() paths (packages/node-core/src/sdk/index.ts and packages/node-core/src/light/sdk.ts) call process.on('SIGTERM', async () => client.flush(200)) on every call. The listener closes over that call's client and nothing removes it, including client.close().
Processes that call init() repeatedly gain one listener per call. Once there are more than 10, Node emits MaxListenersExceededWarning, and on SIGTERM every stale client gets flushed. We hit this in the Sentry CLI (getsentry/toolkit#1692). In library mode it re-inits the light SDK for each command, so @sentry/bundler-plugins source-map uploads during Vercel builds produce the warning after about 11 commands.
Reproduction
process.env.VERCEL='1';constSentry=require('@sentry/node-core/light');for(leti=0;i<15;i++)Sentry.init({});console.log(process.listenerCount('SIGTERM'));// 15, plus a MaxListenersExceededWarning
Expected
A single SIGTERM listener that flushes the latest client, as @sentry/node does on v11 since #25146.
Notes
v11 (develop) is not affected: node-core was merged into @sentry/node, and #25146 fixed setupVercelKeepAlive. This only needs a fix on v10.
Activity
linear-code commentedon Oct 28, 2026
JS-4031
fix(v10/node-core): Register the Vercel SIGTERM listener once (#25826)