Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-initialize state on Redis if missing #25

Merged
merged 3 commits into from
May 20, 2018

Conversation

scascketta
Copy link

@scascketta scascketta commented Sep 1, 2017

Hi! I was testing how pybreaker would behave in various scenarios where state is being stored on Redis and the Redis server misbehaves. CircuitRedisStorage will handle intermittent and complete connection loss with the Redis server in an acceptable manner. But it doesn't handle data loss on the Redis server gracefully (it always expects to find the state on Redis).

This change modifies the state property so that if it appears that state on Redis was lost, it will try to setup the state on Redis again with the initial circuit breaker state.

CircuitRedisStorage will handle RedisErrors fine, and can re-connect fine.
But if the Redis server it was connected lost its data, this will throw an error.
If it appears that state on Redis was lost, then setup the state on Redis again
with the initial circuit breaker state.
@danielfm danielfm merged commit 9f8cd75 into danielfm:master May 20, 2018
@danielfm
Copy link
Owner

Thanks!

@scascketta scascketta deleted the redis-recover branch May 22, 2018 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants