Restart daemon if its thread shuts down unexpectantly #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the
Process
to restart itsDaemon
if the daemonstops unexpectantly. There is a small chance this could happen
since all redis errors are rescued already but its possible for
the daemon thread to crash and the process will keep running. This
changes it so the process periodically checks in on the daemon as
its listening for signals, if the daemon is no longer running, then
the process restarts it. This avoids the strange case where the
process is running but its not running any jobs because the daemon
has stopped but the
Process
is still waiting for signals.@kellyredding - Ready for review. I noticed this over the weekend while I was messing with some stuff, but like I mentioned, it's a really minor case but I like it. Most likely, if the daemon is crashing its because I broke something while changing Qs. If we don't like restarting the daemon, the other option is to have the process just exit out if it sees its daemon crashed.