Skip to content

Use new process.on('SIGTERM') to flush on Vercel #17567

Description

@mydea

Description

See https://vercel.com/changelog/vercel-functions-now-support-graceful-shutdown, Vercel has added a new way to handle graceful shutdown. We should use it to flush events in Sentry effectively:

process.on('SIGTERM', () => {
  Sentry.flush();
});

Things to figure out:

  • Where should we call this? I guess this is not Next.js specific. So I would propose to add this in both Node as well as vercel-edge SDKs guarded by an env-var check for process.env.VERCEL?
  • We should test that this actually works (in both edge and node)
  • We should remove eventually remaining code to handle this in a more hacky way, using waitUntil or similar for vercel

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions