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

[Bug]: ExceptionsAllowedBeforeBreaking is not working. #1716

Closed
ks1990cn opened this issue Oct 22, 2023 · 3 comments
Closed

[Bug]: ExceptionsAllowedBeforeBreaking is not working. #1716

ks1990cn opened this issue Oct 22, 2023 · 3 comments
Labels

Comments

@ks1990cn
Copy link

Describe the bug

Hi,

I've downstream API which is throwing error and another API which is calling this endpoint through HTTPClient. I am setting ExceptionsAllowedBeforeBreaking = 2 and after two consecutive errors circuit breaker should stop calling downstream endpoint. But we keep on getting same exception thrown by downstream endpoint.

Expected behavior

Circuit breaker should work for ExceptionsAllowedBeforeBreaking property when it exceeds more than defined errors.

Actual behavior

Getting same error from downstream API, looks like circuit breaker doesn't work here.

Attaching GIF for reference.

Here Downstream API have endpoint which throws error and Debugging.API is consuming downstream API through HttpClient and Polly.

Circuitbreaker Polly

Steps to reproduce

  1. Bug can be replicated by https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html

  2. Just create 2 API, call endpoint of one API through another using HTTPClient and setup ExceptionsAllowedBeforeBreaking = 2. Make sure to through exception from downstream API and see circuitbreaker not working.

Exception(s) (if any)

No response

Polly version

8.0.0

.NET Version

7.0

Anything else?

No response

@ks1990cn ks1990cn added the bug label Oct 22, 2023
@martincostello
Copy link
Member

Please provide a minimal runnable repro for your issue as code, ideally in a GitHub repository we can easily clone and run.

@ks1990cn
Copy link
Author

ks1990cn commented Oct 23, 2023

Please provide a minimal runnable repro for your issue as code, ideally in a GitHub repository we can easily clone and run.

To run locally:
1.) Clone https://github.com/ks1990cn/Ocelot/tree/ts/issue_1550
2.) Multiple setup startup projects - Debugging.API + Debugging.Downstream.
3.) From postman hit - http://localhost:{portNumberOfDebugging.API}/fu

Here Debugging.API/fu will hit /fileUpload of Debugging.Downstream endpoint because Debugging.API is using Ocelot with Polly.

In Ocelot.Json, I've cofigured using https://ocelot.readthedocs.io/en/latest/features/qualityofservice.html doc.

@ks1990cn
Copy link
Author

ks1990cn commented Oct 24, 2023

Closing this, it was configuration issue.

Configured again from https://www.youtube.com/watch?v=z6YcU0PW_9E&t=1s

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

No branches or pull requests

2 participants