-
Notifications
You must be signed in to change notification settings - Fork 107
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
Fix stuck halfOpen when using errorFilter #389
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the PR - thanks! But I'm not sure about the implementation. See code comments...
When an error is filtered by an errorFilter the request is considered neither success nor failure, leaving the circuit in an inconsistent state. This fixes that issue by emitting success event when the error is filtered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test (or assertion) that a fallback function was not called even if the circuit has one.
When an error is filtered, it is considered a success, so the fallback function should not be used. In that case the circuit would return the error as returned by the underlying service.
@jairelton thanks for making the change. In reviewing it, I realized that past behavior has been that, whether or not the error is filtered, What I have suggested you do is changing the the behavior, and now I am having second thoughts about it because this would really be a |
@lholmquist do you mind taking a look and letting me know what you think? |
When an error is filtered, it is considered a success, however we need a result to resolve with, this way, we should call fallback to get a valid result. If there is no fallback, we reject to give the application a chance to handle the error.
@lholmquist I'm going to land this for now, but let's keep an eye on how filters/fallbacks are used going forward. |
Fix issue #388