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

TimeoutException in AbstractCommand doesn't chain its cause #1119

Closed
pz7 opened this issue Mar 5, 2016 · 2 comments · Fixed by #1120
Closed

TimeoutException in AbstractCommand doesn't chain its cause #1119

pz7 opened this issue Mar 5, 2016 · 2 comments · Fixed by #1120

Comments

@pz7
Copy link

pz7 commented Mar 5, 2016

When getting the TimeoutException from hystrix command we can't trace it down to our specific code.
The issue seems to be that the TimeoutException created in the AbstractCommand (around line 600) is not chaining its cause.

I suggest to change the code from:

return getFallbackOrThrowException(HystrixEventType.TIMEOUT, FailureType.TIMEOUT, "timed-out", new TimeoutException());

to something like this:

TimeoutException timeoutException = new TimeoutException();
timeoutException.initCause(t); // IMPORTANT - chaining to the cause
return getFallbackOrThrowException(HystrixEventType.TIMEOUT, FailureType.TIMEOUT, "timed-out", timeoutException);

Thanks.

@mattrjacobs
Copy link
Contributor

This was a premature optimization to save on allocations. As you brought up, the ability to get the proper cause is more important than saving the allocation. This will go out in next release (sometime this week)

@pz7
Copy link
Author

pz7 commented Mar 8, 2016

👍

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 a pull request may close this issue.

2 participants