googleapis / googleapis/google-cloud-node

SIGABRT when using `@google-cloud/resource-manager`, with trace events, and doing a `process.exit(0)`

Open
#4,384 1 comment 0 reactions 0 assignees View on GitHub
priority: p2 type: bug
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

#### Environment details

- which product (packages/*): @google-cloud/resource-manager
- OS: macosx
- Node.js version: v18.14.2
- npm version: 8
- google-cloud-node version: 4.3.0

#### Steps to reproduce

If you use the `google-cloud/resource-manager` and then also implement shutdown hooks within your application that gracefully stop things like a webserver, before doing a `process.exit(0)`; then you end up with a `SIGABRT`:

```
❯ NODE_OPTIONS="--trace-events-enabled --trace-event-categories v8" node test.js
hi
hi
hi
hi
hi
^C[1] 55453 abort NODE_OPTIONS="--trace-events-enabled --trace-event-categories v8" node test.j
```

This code reproduces the issue:
```
const Crm = require('@google-cloud/resource-manager')
const client = new Crm.ProjectsClient()

const interval = setInterval(() => {
console.log('hi')
}, 500)

const shutdown = () => {
process.exit(0)
}
process.on('SIGINT', shutdown)
process.on('SIGTERM', shutdown)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.