-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ThreadPoolBulkhead with TimeLimiter, seeing TimeoutExceptions #2103
Comments
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: