I had an idea to make it possible to terminate the other subprocesses if one process exits with an error. Right now that's difficult because the events are handled all over the place. I count five different ways that a goreman subprocess can quit:
-
Immediately on cmd.Start() failure, which usually means the command could
not be found on the PATH, it's not executable, or some other failure starting
the subprocess.
-
Subprocess decides to exit.
-
Individually stopped by rpc.go.
-
Stopped (and immediately restarted) by rpc.go.
-
By a signal forwarded to the subprocess from the parent, e.g SIGTERM.
These are variously handled in different places across the codebase, which makes inter-process signaling difficult.
Consolidating these into a single place where all incoming events are handled, from different sources:
- bubbled up from a subprocess
- incoming signal
- incoming rpc message
Could simplify the event handling logic. The problem is it would involve a lot of refactoring of the code. I can try to make it as incremental as possible, but it might be difficult.
I had an idea to make it possible to terminate the other subprocesses if one process exits with an error. Right now that's difficult because the events are handled all over the place. I count five different ways that a goreman subprocess can quit:
Immediately on
cmd.Start()failure, which usually means the command couldnot be found on the PATH, it's not executable, or some other failure starting
the subprocess.
Subprocess decides to exit.
Individually stopped by rpc.go.
Stopped (and immediately restarted) by rpc.go.
By a signal forwarded to the subprocess from the parent, e.g SIGTERM.
These are variously handled in different places across the codebase, which makes inter-process signaling difficult.
Consolidating these into a single place where all incoming events are handled, from different sources:
Could simplify the event handling logic. The problem is it would involve a lot of refactoring of the code. I can try to make it as incremental as possible, but it might be difficult.