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

Question - best way to implement in a serverless environment with concurrent executions #781

Open
lext05 opened this issue Jun 21, 2023 · 1 comment

Comments

@lext05
Copy link

lext05 commented Jun 21, 2023

Hi,

I understand this library has support for saving and loading states using an external storage. However, I am wondering how to best handle concurrent executions and updating the stats.

For example, if breaker.stats stored in an external storage for success is initially 0, and two executions read the state with both functions passing, I assume the breaker.stats would be updated to 1 in both cases. If we were to write stats in both cases to external storage, they would both write 1, when in reality there were 2 successes.

Should we be handling incrementing these stats ourselves and calculating the other fields like percentiles?

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant