Skip to content

Script won't exit with ANR and captureStackTrace active #10022

Description

@joshkel

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

7.91.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

 Sentry.init({
    dsn: process.env.SENTRY_DSN,
    integrations: [new Sentry.Integrations.Anr({captureStackTrace: true})],
  });

Steps to Reproduce

import * as Sentry from '@sentry/node';

function configureSentry() {
  Sentry.init({
    dsn: process.env.SENTRY_DSN,
    integrations: [new Sentry.Integrations.Anr({captureStackTrace: true})],
  });
}

async function main() {
  configureSentry();
  await new Promise(resolve => setTimeout(resolve, 1000));
  process.exit(0);
}

main();

Expected Result

The program cleanly exits after 1 second.

Actual Result

The program waits forever with the following console output:

Debugger listening on ws://127.0.0.1:55686/bf184600-b574-49d0-9b00-3640e71b55ed
For help, see: https://nodejs.org/en/docs/inspector
Waiting for the debugger to disconnect...

I can find no workaround.

Activity

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

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions