Repository navigation
Commit 2180999
fix(stdio): exit cleanly when fatal logging hits a dead pipe (#1276)
## Summary
Fixes #1274. When the MCP client dies and closes stderr, the old fatal
handlers could throw while logging, get re-invoked forever, and leave
orphaned processes spinning at 100%+ CPU.
### Key Changes
- One shared exit path for uncaught exceptions, unhandled rejections,
and stdio startup failures
- Catch logging/reporting failures so a dead stderr cannot throw inside
the handler
- Always `process.exit(1)`, including a timeout if Sentry flush hangs
### Breaking Changes
- None
<!-- junior-request-attribution:start -->
Requested by **David Cramer**.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC08J1NSPU6S%3A1787941530.610869 -->
--
[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC08J1NSPU6S%3A1787941530.610869)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC08J1NSPU6S%3A1787941530.610869/?project=4510944073809921)
<!-- junior-session-footer:end -->
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <david@sentry.io>1 parent d024020 commit 2180999
1 file changed
Lines changed: 35 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
333 | 358 | | |
334 | 359 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 360 | + | |
| 361 | + | |
340 | 362 | | |
341 | 363 | | |
342 | 364 | | |
| |||
362 | 384 | | |
363 | 385 | | |
364 | 386 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 387 | + | |
| 388 | + | |
370 | 389 | | |
371 | 390 | | |
372 | 391 | | |
| |||
0 commit comments