Skip to content

CloudEventBus circuit breaker stuck in a loop : The circuit is now open and is not allowing calls. #75

Closed
@JBBianchi

Description

@JBBianchi

What happened:
The following error keeps appearing in the server logs:

System.Net.Http.HttpClient.CloudEventBus.LogicalHandler: Information: Start processing HTTP request POST https://en37uhd2he6t4.x.pipedream.net/
System.Net.Http.HttpClient.CloudEventBus.ClientHandler: Information: Sending HTTP request POST https://en37uhd2he6t4.x.pipedream.net/
System.Net.Http.HttpClient.CloudEventBus.ClientHandler: Information: Received HTTP response headers after 722.1693ms - 413
Neuroglia.Eventing.Services.CloudEventBus: Error: An error occured while posting a cloud events to the broker: Polly.CircuitBreaker.BrokenCircuitException`1[System.Net.Http.HttpResponseMessage]: The circuit is now open and is not allowing calls.
   at Polly.CircuitBreaker.CircuitStateController`1.OnActionPreExecute()
   at Polly.CircuitBreaker.AsyncCircuitBreakerEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext, ExceptionPredicates shouldHandleExceptionPredicates, ResultPredicates`1 shouldHandleResultPredicates, ICircuitController`1 breakerController)
   at Polly.AsyncPolicy`1.ExecuteAsync(Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
   at Polly.Wrap.AsyncPolicyWrapEngine.<>c__DisplayClass0_0`1.<<ImplementationAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Func`5 onRetryAsync, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider, Boolean continueOnCapturedContext)
   at Polly.AsyncPolicy`1.ExecuteAsync(Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
   at Polly.Wrap.AsyncPolicyWrapEngine.ImplementationAsync[TResult](Func`3 func, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext, IAsyncPolicy`1 outerPolicy, IAsyncPolicy`1 innerPolicy)
   at Polly.AsyncPolicy`1.ExecuteAsync(Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
   at Microsoft.Extensions.Http.PolicyHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Neuroglia.Eventing.Services.CloudEventBus.<>c__DisplayClass31_0.<<DequeueAndPublishPendingEventsAsync>b__1>d.MoveNext()

(because the output payload of a workflow/state/action was too big???)

What you expected to happen:
No error, or, at best, a limited numbers of retries?

How to reproduce it:
Not sure, try:

  • Launch the server in self-hosted mode
  • Add the following workflow def:
{
        "id": "order-dog",
        "version": "1.0.0",
        "specVersion": "0.8",
        "name": "Order pet",
        "description": "A workflow used to order a pet on the Swagger pet store",
        "functions": [
            {
                "name": "get-user-by-name",
                "type": "rest",
                "operation": "https://petstore.swagger.io/v2/swagger.json#getUserByName"
            },
            {
                "name": "login-user",
                "type": "rest",
                "operation": "https://petstore.swagger.io/v2/swagger.json#loginUser"
            },
            {
                "name": "get-pets-by-status",
                "type": "rest",
                "operation": "https://petstore.swagger.io/v2/swagger.json#findPetsByStatus"
            },
            {
                "name": "create-order",
                "type": "rest",
                "operation": "https://petstore.swagger.io/v2/swagger.json#findPetsByStatus"
            }
        ],
        "states":[
            {
                "name": "PlaceOrder",
                "type": "operation",
                "actions": [
                    {
                        "name": "Get User Info",
                        "functionRef":{
                            "refName": "get-user-by-name",
                            "arguments":{
                                "username": "${ .username }"
                            }
                        }, 
                        "actionDataFilter":{
                            "toStateData": "${ .user }"
                        }
                    },
                    {
                        "name": "Login",
                        "functionRef":{
                            "refName": "login-user",
                            "arguments":{
                                "username": "${ .username }",
                                "password": "${ .password }"
                            }
                        }
                    },
                    {
                        "name": "Get Dog To Order",
                        "functionRef": {
                            "refName": "get-pets-by-status",
                            "arguments":{
                                "status": "available"
                            }
                        },
                        "actionDataFilter":{
                            "toStateData": "${ .dogToOrder }"
                        }
                    },
                    {
                        "name": "Place order",
                        "functionRef":{
                            "refName": "create-order",
                            "arguments":{
                                "petId": "${ .dogToOrder.id }",
                                "quantity": "${ .quantityToOrder }",
                                "complete": true
                            }
                        },
                         "actionDataFilter":{
                            "toStateData": "${ .order }"
                        }
                    }
                ],
                "end": true
            }
        ]}
  • Launch an instance with an existing user/pet

Environment:
Win 10 x64 - self hosted

Metadata

Metadata

Assignees

Labels

app: apiConcerns the API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions