Discussion:
Hystrix Fallback not executed on Thread Pool/Semaphore rejection
Maxime Tremblay
2016-10-31 14:44:36 UTC
Permalink
Hi,

In the Camel-Hystrix component, what motivated the choice the execute the
Fallback only when an Exception is raised ?

Why not to let the end user choose if they want to execute the fallback or
not when no Exception is raised ?

To put in context:

The getFallback() is called by Hystrix in all the cases documented in
Hystrix doc:
"Hystrix will execute this fallback for all types of failure such as run()
failure, timeout, thread pool or semaphore rejection, and circuit-breaker
short-circuiting. "

Cf: https://github.com/Netflix/Hystrix/wiki/How-To-Use#Fallback

However, Camel-Hystrix sometimes does not execute the fallback, eg. on
thread pool or semaphore rejection, because no Exception is raised those
cases.

Cf line 50 of:
https://github.com/apache/camel/blob/master/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java

Best Regards,

Max
Claus Ibsen
2016-11-01 11:23:54 UTC
Permalink
Hi

Ah yes thats a bug. I have logged a ticket
https://issues.apache.org/jira/browse/CAMEL-10430

We should get the exception from the command which then also has
exception for other kind of failures such as rejected etc



On Mon, Oct 31, 2016 at 3:44 PM, Maxime Tremblay
Post by Maxime Tremblay
Hi,
In the Camel-Hystrix component, what motivated the choice the execute the
Fallback only when an Exception is raised ?
Why not to let the end user choose if they want to execute the fallback or
not when no Exception is raised ?
The getFallback() is called by Hystrix in all the cases documented in
"Hystrix will execute this fallback for all types of failure such as run()
failure, timeout, thread pool or semaphore rejection, and circuit-breaker
short-circuiting. "
Cf: https://github.com/Netflix/Hystrix/wiki/How-To-Use#Fallback
However, Camel-Hystrix sometimes does not execute the fallback, eg. on
thread pool or semaphore rejection, because no Exception is raised those
cases.
https://github.com/apache/camel/blob/master/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/HystrixProcessorCommand.java
Best Regards,
Max
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Maxime Tremblay
2016-11-01 14:50:20 UTC
Permalink
Great, thank you for the fix.
Post by Claus Ibsen
Hi
Ah yes thats a bug. I have logged a ticket
https://issues.apache.org/jira/browse/CAMEL-10430
We should get the exception from the command which then also has
exception for other kind of failures such as rejected etc
On Mon, Oct 31, 2016 at 3:44 PM, Maxime Tremblay
Post by Maxime Tremblay
Hi,
In the Camel-Hystrix component, what motivated the choice the execute the
Fallback only when an Exception is raised ?
Why not to let the end user choose if they want to execute the fallback
or
Post by Maxime Tremblay
not when no Exception is raised ?
The getFallback() is called by Hystrix in all the cases documented in
"Hystrix will execute this fallback for all types of failure such as
run()
Post by Maxime Tremblay
failure, timeout, thread pool or semaphore rejection, and circuit-breaker
short-circuiting. "
Cf: https://github.com/Netflix/Hystrix/wiki/How-To-Use#Fallback
However, Camel-Hystrix sometimes does not execute the fallback, eg. on
thread pool or semaphore rejection, because no Exception is raised those
cases.
https://github.com/apache/camel/blob/master/components/
camel-hystrix/src/main/java/org/apache/camel/component/hystrix/processor/
HystrixProcessorCommand.java
Post by Maxime Tremblay
Best Regards,
Max
--
Claus Ibsen
-----------------
Camel in Action 2: https://www.manning.com/ibsen2
Loading...