Currently Timeout exceptions does not trigger circuit breaker. But they should. I don't want to continue spam my server, if it slightly started dying.
I tried to hot-fix in the next way - hot_fix.diff
The idea behind patch is next. Currently we wrap our call with circuit breaker and only after that with time limiter. So, circuit breaker doesn't know anything about time-outs.
And basically I do opposite - initially wrap call with time limiter and only after that, wrap it with circuit breaker. So circuit breaker will aware about time-out exception and can react properly.
The issue which I have afterward, that, for cases when circuit breaker was open, I started receiving blank 200 OK response.
I tried to fix it by removing recover(fallbackTask) part at all:
And seems like it works fine. But tests are failing, and I'm not sure how exactly it should be fixed.
Also another fix, which seems like works fine and tests are not failing: