You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using ThreadPoolBulkhead with TimeLimiter, but unexpectedly seeing TimeoutExceptions.
It appears that the TimeLimiter starts counting when the function is "submitted", not when it actually starts execution.
callApi(...) in this example takes 5 seconds to respond.
I have confirmed it is not the api timing out, in fact in this experiment, I have just changed it to just do Thread.sleep(5000); to confirm.
In this situation, if execute is called 10 times at the same time (concurrently). Then I get TimeoutException.
My observation is that the bulkhead will let 1 call at a time, 5s each. Then on the 10th call, it will throw TimeoutException.
Even though each execution of callApi(...) only takes 5s.
Is this behaviour expected? My expectation was that the timeout was to apply to each execution of callApi(...)
i.e. TimeoutException is thrown if callApi(...) takes longer than 45s.
The text was updated successfully, but these errors were encountered:
Resilience4j version: 1.7.1
Java version: 8
*Also tried with 2.2.0 & Java 17
I am using ThreadPoolBulkhead with TimeLimiter, but unexpectedly seeing TimeoutExceptions.
It appears that the TimeLimiter starts counting when the function is "submitted", not when it actually starts execution.
My simplified example:
Here with configuration settings:
callApi(...)
in this example takes 5 seconds to respond.I have confirmed it is not the api timing out, in fact in this experiment, I have just changed it to just do
Thread.sleep(5000);
to confirm.In this situation, if
execute
is called 10 times at the same time (concurrently). Then I getTimeoutException
.My observation is that the bulkhead will let 1 call at a time, 5s each. Then on the 10th call, it will throw
TimeoutException
.Even though each execution of
callApi(...)
only takes 5s.Is this behaviour expected? My expectation was that the timeout was to apply to each execution of
callApi(...)
i.e.
TimeoutException
is thrown ifcallApi(...)
takes longer than 45s.The text was updated successfully, but these errors were encountered: