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

premature closing? #301

Open
mr-git opened this issue Jan 31, 2024 · 1 comment
Open

premature closing? #301

mr-git opened this issue Jan 31, 2024 · 1 comment

Comments

@mr-git
Copy link

mr-git commented Jan 31, 2024

We are trying to use this library and we observe very strange behaviour:

  • handling of valid request takes about a second
  • bot is hitting server rapidly with many requests within short intervals, like tens of requests per second
  • CircuitBreaker (CB) is configured to open after 10 failures for a minute
  • CircuitBreaker (CB) is Closed
  • CB.protect(..) starts handling one of the calls, let's name it X
  • next 10+ requests fail due to internal locking and opens CB
  • CB rejects some requests as expected using fail-fast shortcut
  • [after a second] X finishes successfully and [unexpectedly for me] closes CB!!! <=== BUG or FEATURE?
  • bot's next call gets through CB as new and slow X+1
  • more requests fail due to internal locking and CB opens
  • [after a second] X+1 finishes and closes CB
  • cycle repeats

Is this expected that on

case Open(_,_) => (ClosedZero, onClosed.attempt.void)

there is no check for expiresAt? similar as on
if (open.expiresAt >= now) onRejected >> F.raiseError(RejectedExecution(open))

@mr-git
Copy link
Author

mr-git commented Feb 1, 2024

image
from: https://doc.akka.io/docs/akka/current/common/circuitbreaker.html, https://doc.akka.io/docs/akka/current/images/circuit-breaker-states.png

There should not be transition from Open to Closed without going through HalfOpen

mr-git added a commit to mr-git/circuit that referenced this issue Feb 1, 2024
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

No branches or pull requests

1 participant