Skip to content

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

Open
@lext05

Description

@lext05

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions