question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fallback function is being executed when errorFilter is applied

See original GitHub issue

Node.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:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
lholmquistcommented, Mar 18, 2021

Just released this fix in 6.0.0

1reaction
lancecommented, Feb 18, 2021

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found