Skip to content
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

Inconsistent behaviour in REST Client Reative in regards of switching between Event Pool / Worker (inherited) executors #32839

Closed
Sgitario opened this issue Apr 23, 2023 · 2 comments · Fixed by #32852

Comments

@Sgitario
Copy link
Contributor

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)

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 23, 2023

/cc @cescoffier (rest-client), @geoand (rest-client)

@Sgitario 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
Copy link
Contributor Author

@Sgitario 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
@quarkus-bot quarkus-bot bot added this to the 3.1 - main milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant