-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Hystrix Javanica Unwraps and Raises Checked Exceptions #1381
Comments
@dmgcodevil can you take a look at this one and recommend a path forward? |
Hi @56quarters it's hard to say that previous behavior was correct and new one is completely wrong. There is long discussion on this subject but it still not clear which design is correct. In this case your suggestion is about wrapping platform errors in @56quarters are you ok with the approach that I suggested in the linked comment from the separate issue ? |
Hi @dmgcodevil, I think the approach outlined in the comment will work combined with wrapping platform errors in Thanks! 👍 Should I leave this issue open? Or close in favor of #1344? |
hi @56quarters , yes, close this one and lets track the progress in #1344. Thanks ! |
Hi,
Starting with hystrix-javanica 1.5.4 (up to the latest master) it seems that
HystrixCommandAspect
starts unconditionally unwrappingHystrixRuntimeExceptions
and re-raising thecause
, no matter what. This becomes a problem when Hystrix commands time out. In this case thecause
will be an instance ofTimeoutException
which is a checked exception. Thus callers of a method that times out get anUndeclaredThrowableException
instead of aHystrixRuntimeException
.I've created a demo project with a
@HystrixCommand
that always times out to demonstrate. This is a Spring Boot project but the problem is unrelated to Spring Boot.Steps
Expected behavior
The method call raises a
HystrixRuntimeException
withfailureType == TIMEOUT
andcause
ofTimeoutException
Actual behavior
The method call raises an
UndeclaredThrowableException
with cause ofTimeoutException
This seems to be related to #1285 and #1344 and caused by the changes in 155d4e9
I think the fix for this is something to the effect of changing
HystrixCommandAspect.getCauseOrDefault
to look like the following:Note the addition of the final
if
to only reraise the cause when the failure is from an exception thrown by the wrapped method.Thanks.
/cc @hroongta
The text was updated successfully, but these errors were encountered: