Skip to content

Conversation

macournoyer
Copy link
Contributor

If a process dies right before we call kill! here:

, the resulting ::Process.kill(:KILL, @pid) will throw an error (Errno::ESRCH (No such process)), and the run loop will exit.

We do want to keep the loop running.

So this PR removes the re-raise, and move the rescue higher up so we count it as a failure.

@ioquatix
Copy link
Member

ioquatix commented Oct 17, 2025

In principle, I'm okay trying out this change.

However:

  1. Killing the same process multiple times is okay. It's only when it's reaped it goes away (Process.wait).
  2. The controller process should be the only one to reap children, otherwise it would be extremely problematic (think about if the pid was reused).
  3. Since we are unsure of exactly what is failing, we might enter into a bad state. Even if we are limping along, it may ultimately be better to crash.

However, in the interest of robustness, and until we can establish the actual source of the issue, let's try this out.

@ioquatix ioquatix merged commit 86421ce into socketry:main Oct 17, 2025
17 of 20 checks passed
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