4

In our project we use the below Hystrix configuration. I am confused about command.default.execution.timeout.enabled property. It is set as false but along with it we have another property which specifies timeoutInMilliseconds, which as per my understanding specifies the time after which the caller will observe a time-out. So if the execution time-out is set as false on the first place, what is the point of having the second property? Please let me know if my understanding is not correct

#
# Hystrix configuration
#

hystrix:
  command.default.execution.timeout.enabled: false
  command.default.execution.isolation.thread.timeoutInMilliseconds: 60000
Syed Ammar
  • 93
  • 2
  • 6

1 Answers1

5

Firstly, please go through the documentation here. It is explained in detail. In the beginning of page, there is definition of 'Default'. Please check that.

Now coming to your specific question
By default command.default.execution.timeout.enabled value is set to true. As you can see in this section. So with code like this

command.default.execution.timeout.enabled: false

you are overriding it to be false. Which means none of the calls will be timed out by hystrix. But you can also see in that same section, we can enable or disable for a particular instance using commandkey.

The same thing applies to command.default.execution.isolation.thread.timeoutInMilliseconds

We have a default value and we can also change this value for a particular commandkey.

Lets assume currently you have this

hystrix:
  command.default.execution.timeout.enabled: false
  command.default.execution.isolation.thread.timeoutInMilliseconds: 60000

After a few days you can add something like

command.myinstancekey.execution.timeout.enabled: true

In this case timeout is enabled for only myinstancekey and it will timeout in 60000 because it takes the value from

command.default.execution.isolation.thread.timeoutInMillisecond

If you have something like

command.myinstancekey.execution.isolation.thread.timeoutInMillisecond: 30000 

Then 30000 is taken as timeout value for mysinstancekey

pvpkiran
  • 25,582
  • 8
  • 87
  • 134