Fallback function is being executed when errorFilter is applied
See original GitHub issueNode.js Version: v12.18.2
Operating System: macOS 10.15.7 (19H114)
Steps to Produce Error:
According to https://github.com/nodeshift/opossum#fallback, the fallback function is supposed to be executed only when the circuit is open. But, when the error filter returns true
, (for eg: error filter is applied to exclude HTTP 404, errorFilter: err => err.statusCode < 500
) the circuit remain closed and the fallback function is still being executed.
The issue seems to be here: https://github.com/nodeshift/opossum/blob/3cb7de98259ecbbfed4dcf9b8ee5187367049907/lib/circuit.js#L658-L664
Would you be able to check if the fallback is supposed to be called in this scenario? Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Why is Fallback function not being executed?
Fallback function does not execute because fallback function works if a transaction hasn't parameters which have a name of call functions.
Read more >opossum 7.0.0 | Documentation - Nodeshift
When a fallback function is triggered, it's considered a failure, and the fallback function will continue to be executed until the breaker is...
Read more >@redhat/opossum 5.0.0 | Documentation
When a fallback function is triggered, it's considered a failure, and the fallback function will continue to be executed until the breaker is...
Read more >opossum | Yarn - Package Manager
If you want, you can provide a fallback function to be executed when in the failure state. For more about the circuit breaker...
Read more >Customizing Zuul Exception - Stack Overflow
So I extended the Zuul Filter I can see it getting into the run method after the error has been executed how do...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just released this fix in 6.0.0
Hi @jerrin. This is a good catch. It’s actually working as intended, but the docs don’t reflect that. A little over a year ago, this was discussed in a pull request. My original ask was to change this behavior so that fallback would not be called. But ultimately we didn’t go that route because it was considered a breaking change. @lholmquist should we revisit this?