-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fallback function is being executed when errorFilter is applied #540
Comments
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? |
This must have slipped through the email cracks, will review today |
It does feel a little odd that if the error filter "succceds" that we are still calling the fallback, that scenario should be considered a success. I have no problems with doing a semver-major change to update this. |
Thank you both for looking into this 👍 |
Just released this fix in 6.0.0 |
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:
opossum/lib/circuit.js
Lines 658 to 664 in 3cb7de9
Would you be able to check if the fallback is supposed to be called in this scenario?
Thanks
The text was updated successfully, but these errors were encountered: