brakes
brakes copied to clipboard
waitThreshold is too high by default
The default setting for waitThreshold is currently set to 100 which is way too high IMO. Imagine a scenario in which the backend system becomes unresponsive and stays broken for a few hours. Assuming you set the circuitDuration to 30 seconds, you would dish out 100 failing requests before opening the circuit breaker again - every 30 seconds. Don't you think that 100 requests is a bit too much for a system which is already struggling?
Of course it is up to the user to tweak the waitThreshold according to their needs but speaking of myself personally, I was very confused when I tried the library in my project and the circuit breaker wouldn't open immediately even though the failure rate was at 100%.
I would think that a waitThreshold of 5 to 10 would be much more appropriate.
I agree it is higher than one would normally want it, but I would be hesitant to change it in a non-breaking version and have it inadvertently change the behavior for users.
Thanks for the suggestion though!