Skip to content

Commit b22648b

Browse files
authored
Ignore pino stream errors (#370)
1 parent f5901e9 commit b22648b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/telemetry/LoggerFactory.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ export class LoggerFactory implements Closeable {
5252
},
5353
});
5454

55+
// Handle stream errors to prevent uncaught exceptions when worker thread exits
56+
const stream = (this.baseLogger as unknown as Record<symbol, NodeJS.EventEmitter>)[pino.symbols.streamSym];
57+
stream?.on?.('error', () => {
58+
// Silently ignore - worker thread has exited during shutdown
59+
});
60+
5561
this.timeout = setTimeout(() => {
5662
void this.cleanOldLogs();
5763
}, 60 * 1000);

0 commit comments

Comments
 (0)