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

Improve event loop integration #1097

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Jan 3, 2025

No description provided.

@Ladicek Ladicek added this to the 6.7.2 milestone Jan 3, 2025
@Ladicek Ladicek force-pushed the improve-eventloop-integration branch 2 times, most recently from 9055715 to 9118c62 Compare January 3, 2025 15:41
@Ladicek
Copy link
Contributor Author

Ladicek commented Jan 3, 2025

This should fix quarkusio/quarkus#45061

This commit mainly improves the `Timeout` strategy implementation to fail
the invocation on timeout on the original thread, if it was remembered
previously (that is, in case of an event loop).

As a side effect, this commit also makes the `TimeoutExecution` class
a little smaller.
@Ladicek Ladicek force-pushed the improve-eventloop-integration branch 2 times, most recently from c6b0bfd to eb83fe2 Compare January 6, 2025 10:53
The `EventLoop` interface was simplified: the `isEventLoopThread()` method was
removed and instead, the `executor()` method is supposed to return `null`
if the current thread is not an event loop thread.

Further, the `VertxEventLoop` implementation considers all Vert.x threads
"event loops", even worker threads.

Finally, the `VertxExecutor` and `ThreadOffload` classes make bigger
effort to keep the execution on the original Vert.x context as remembered
at the beginning by `RememberEventLoop`.
The improvements mainly consist of:

- running each service call on a separate duplicated context;
- running each test on an event loop thread and on a worker thread.

This better simulates what happens in practice (at least in Quarkus).

Further, some new tests are added:

- timeouts with Vert.x;
- asynchronous execution with Vert.x, where the future is completed
  on a different kind of thread than the original.
@Ladicek Ladicek force-pushed the improve-eventloop-integration branch from eb83fe2 to 8dadb5d Compare January 6, 2025 10:54
@Ladicek Ladicek merged commit c520dfa into smallrye:main Jan 6, 2025
16 checks passed
@Ladicek Ladicek deleted the improve-eventloop-integration branch January 6, 2025 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant