Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
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()],
});
Steps to Reproduce
import * as Sentry from '@sentry/node';
function configureSentry() {
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [new Sentry.Integrations.Anr()],
});
}
async function main() {
configureSentry();
await new Promise(resolve => setTimeout(resolve, 1000));
}
main();
Expected Result
The program cleanly exits after 1 second.
Actual Result
The program waits forever.
It appears that the ANR integration's timer keeps the program alive, and its unref call therefore has no effect.
This is easy to work around with an explicit process.exit()
call. If this behavior is intended, then perhaps the docs should be updated?
See also #10022.
Metadata
Metadata
Assignees
Type
Projects
Status
No status