When a process exits non-zero ampoule tries to immediately replace it,
this is a problem if the process exits non-zero when recycling because
ampoule also tries to immediately replace the recycled process.
startWorker adds a callback that tries to replace the process.
and recycling calls stopAWorker and adds a callback that tries to start
a new process.
In the case where Shutdown causes a non-zero exit code this caused
two startAWorker invocations for every recycled process.
When a process exits non-zero ampoule tries to immediately replace it, this is a problem if the process exits non-zero when recycling because ampoule also tries to immediately replace the recycled process.
startWorker
adds a callback that tries to replace the process. and recycling callsstopAWorker
and adds a callback that tries to start a new process.In the case where
Shutdown
causes a non-zero exit code this caused twostartAWorker
invocations for every recycled process.