Skip to content

Wrong http status (503) returned when the circuit didn't trip #11

@panizzag

Description

@panizzag
  • Current behavior: Policy returns 503 when the circuit didn't trip yet (errorCount < failure threshold, CLOSED state)

image

  • Expected behavior: should respond with the proper status code (500) and print the CB state
  • Resolution:

Make dynamic the following code

<http-transform:set-response statusCode="503">

Using the pseudocode:

  • if state CLOSED then return the underlying service status code
  • else assing 503 (service unavailable), as-is

The rationale behind the request: this policy might be applied to existing services and we should ensure backward compatibility without breaking the consumer experience, therefore we shouldn't change the first error returned if the failureThreshold > 1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions