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
The REST Client Reactive is not using the Event Loop thread pool at the beginning, but the Worker thread pool (see here).
Then, the handler ClientSendRequestHandler switches to the Event Loop thread here.
And the problem is that if the response from the server arrives before the client ends with the ClientSendRequestHandler handler, the client will keep using the Worker thread pool. Why?
1.- First, the ClientSendRequestHandler handler suspends the execution here.
2.- Second, the ClientSendRequestHandler handler performs the request to the server and subscribes to the response. After receiving the response, it resumes the execution here.
Now, we have two scenarios:
Scenario A: Happy path
Because 1., the client suspends the execution and will wait for the resume. This condition will be true and the while loop will end.
After receiving the response from the server, the execution will resume using the Event Loop thread pool (provided by this method).
Scenario B: When server flies: The cause of the test failures
Before the client suspends the execution, if the server returns the response, the execution will be resumed because of 2. But because the execution was never suspended, it won't invoke the getEventLoop() method (see here). Note that taking into account the execution was never suspended, I think this logic is correct.
Sgitario
changed the title
Inconsistent behaviour in REST Client Reative in regards switching among Event Pool / Worker or original thread
Inconsistent behaviour in REST Client Reative in regards switching between Event Pool / Worker (inherited) executors
Apr 23, 2023
Sgitario
changed the title
Inconsistent behaviour in REST Client Reative in regards switching between Event Pool / Worker (inherited) executors
Inconsistent behaviour in REST Client Reative in regards of switching between Event Pool / Worker (inherited) executors
Apr 24, 2023
Sgitario
added a commit
to Sgitario/quarkus
that referenced
this issue
Apr 24, 2023
The REST Client Reactive is not using the Event Loop thread pool at the beginning, but the Worker thread pool (see here).
Then, the handler ClientSendRequestHandler switches to the Event Loop thread here.
And the problem is that if the response from the server arrives before the client ends with the ClientSendRequestHandler handler, the client will keep using the Worker thread pool. Why?
1.- First, the ClientSendRequestHandler handler suspends the execution here.
2.- Second, the ClientSendRequestHandler handler performs the request to the server and subscribes to the response. After receiving the response, it resumes the execution here.
Now, we have two scenarios:
Scenario A: Happy path
Because 1., the client suspends the execution and will wait for the resume. This condition will be true and the while loop will end.
After receiving the response from the server, the execution will resume using the Event Loop thread pool (provided by this method).
Scenario B: When server flies: The cause of the test failures
Before the client suspends the execution, if the server returns the response, the execution will be resumed because of 2. But because the execution was never suspended, it won't invoke the
getEventLoop()
method (see here). Note that taking into account the execution was never suspended, I think this logic is correct.Originally posted by @Sgitario in #32644 (comment)
The text was updated successfully, but these errors were encountered: