Skip to content

Conversation

@Hormold
Copy link
Contributor

@Hormold Hormold commented Dec 26, 2025

Description

Fix supervisor process crashes when child process dies unexpectedly

Changes Made

  • Wrap pidusage() in try-catch, return 0 if process is gone (ENOENT)
  • Check proc.connected before all send() calls to avoid ERR_IPC_CHANNEL_CLOSED
  • Call clearTimers() in exit handler (was only in error handler)
  • Remove throw err after reject(err) in setTimeout (was causing uncaught exception) (not sure here)

Pre-Review Checklist

  • Build passes: All builds (lint, typecheck, tests) pass locally
  • AI-generated code reviewed: Removed unnecessary comments and ensured code quality
  • Changes explained: All changes are properly documented and justified above
  • Scope appropriate: All changes relate to the PR title, or explanations provided for why they're included

Testing

  • Automated tests added/updated (if applicable)
  • All tests pass

Note to reviewers: Please ensure the pre-review checklist is completed before starting your review.

@changeset-bot
Copy link

changeset-bot bot commented Dec 26, 2025

⚠️ No Changeset found

Latest commit: dff47bd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

- Handle pidusage ENOENT on dead process
- Check proc.connected before send()
- Clear timers on exit
- Remove throw after reject in setTimeout
@Hormold Hormold force-pushed the fix/supervised-proc-crash-on-child-death branch from d01b560 to dff47bd Compare December 26, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants