Skip to content

Commit a0e73c6

Browse files
authored
Log process warnings to diagnose EventEmitter memory leak (#60900)
1 parent b81b85e commit a0e73c6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/observability/lib/handle-exceptions.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ process.on('uncaughtException', async (err: Error | unknown) => {
1515
}
1616
})
1717

18+
process.on('warning', (warning: Error) => {
19+
logger.warn(warning.message, {
20+
warning_name: warning.name,
21+
warning_stack: warning.stack,
22+
})
23+
})
24+
1825
process.on('unhandledRejection', async (err: Error | unknown) => {
1926
const error = toError(err)
2027
logger.error('unhandledRejection', { error })

0 commit comments

Comments
 (0)