Skip to content
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

Updates HystrixCommand to expose an isCommandTimedOut() method. #144

Closed
wants to merge 2 commits into from

Conversation

UnquietCode
Copy link
Contributor

Updates HystrixCommand to expose an isCommandTimedOut() method, which can be helpful when determining what to do inside of getFallback().

Updates HystrixCommand to expose an isCommandTimedOut() method, which can be helpful when determining what to do inside of getFallback().
@UnquietCode
Copy link
Contributor Author

This would be very helpful to work that I'm doing. Since the other two booleans are exposed, it seems like this would be safe to add.

@cloudbees-pull-request-builder

Hystrix-pull-requests #17 FAILURE
Looks like there's a problem with this pull request

@benjchristensen
Copy link
Contributor

What are you trying to accomplish that isn't offered by this existing method?

    /**
     * Whether the response received was the result of a timeout
     * and <code>getFallback()</code> being called.
     * 
     * @return boolean
     */
    public boolean isResponseTimedOut() {
        return executionResult.events.contains(HystrixEventType.TIMEOUT);
    }

*
* @return boolean
*/
public boolean isFailedExecution() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume it's a mistake that this change deletes the isFailedExecution method?

@cloudbees-pull-request-builder

Hystrix-pull-requests #18 FAILURE
Looks like there's a problem with this pull request

@UnquietCode
Copy link
Contributor Author

Oh lord, that's terrible. I used the GH editor and I guess I pasted over it. Sorry, fixed now. Though it looks like maybe there are unrelated build failures from master?

@UnquietCode
Copy link
Contributor Author

@benjchristensen isResponseTimedOut() seems to return false from inside of getFallback(), so I assumed it refers to the response after the fallback is processed.

@benjchristensen
Copy link
Contributor

I think this just means we should fix the existing method rather than adding another that is basically a duplicate.

Can you provide a unit test that shows isResponseTimedOut() returning false inside getFallback() when run() timed-out?

@UnquietCode
Copy link
Contributor Author

Sure thing. If that is the expected behavior then here is a small failing test: UnquietCode@a300d93

(it's on it's own branch: https://github.com/UnquietCode/Hystrix/branches/unquietcode_pull_144)

@benjchristensen
Copy link
Contributor

Thank you @UnquietCode for this report and the unit test. I have merged your test and implemented a fix that exposes not just timeout but any failure state to the getFallback method.

#149

neerajrj pushed a commit to neerajrj/Hystrix that referenced this pull request Nov 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants