Skip to content

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

Closed
@joshkel

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.

Metadata

Metadata

Assignees

Labels

Package: nodeIssues related to the Sentry Node SDK

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions