Commit 7b2e8d8
Clean up dead thread from process_instances when replacing it
When a thread dies, `replace_thread` deleted its entry from
`configured_processes` but not from `process_instances`. On the next
supervise loop, `check_and_replace_terminated_processes` would find the
same dead thread again, call `replace_thread`, and
`configured_processes.delete(thread_id)` would return nil — crashing
with `undefined method 'instantiate' for nil`.
Mirror the pattern already used in `ForkSupervisor#replace_fork`:
delete from `process_instances` first and guard against the entry
already being gone.
Fixes #710
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 5518a4d commit 7b2e8d8
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | | - | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
0 commit comments