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 PR adds support to use redis for pause / continue horizons instances, without removing existing behavior.
Motivation
The current implementation relies on you being able to ssh into the server is running horizon so you can pause, which can be limiting in the following scenarios:
Multiple Servers
If you have multiple horizons instances running, in case you need to pause, you would need to ssh on each instance and call pause.
Blue/green deploying on Kubernetes
On Kubernetes it's quite a challenge ssh into the container, specially if you have replicas, etc.
Also, if you want to pause while deploying for example, you probably want to use something like initContainer or before helm hook to run that, which will spawn a new container to run that.
On current implementation it's quite impossible.
In my case, as the old horizon is still running while we're deploying, we can have race conditions, running job on old code until we finish deploy and kill the old one. We should always recommend running pause before deploying i think (not sure it's already done somewhere) 馃
Looking for Feedback
I kept the existing signals approach so we kind of do the pause logic twice... what we could do:
docker-compose.yml
to make easier to test locallypredis
as it skips the requirement of redis extension on local