Skip to content

Avoid deadlocks using thread pool with context to run async futures#2475

Merged
MikeEdgar merged 1 commit intostreamshub:mainfrom
MikeEdgar:fix-deadlock
Apr 11, 2026
Merged

Avoid deadlocks using thread pool with context to run async futures#2475
MikeEdgar merged 1 commit intostreamshub:mainfrom
MikeEdgar:fix-deadlock

Conversation

@MikeEdgar
Copy link
Copy Markdown
Member

Currently, when CompletionStage *Async methods are invoked with the executor provided by a ThreadContext, the thread that runs the task may be a Kafka Admin client thread. Additional use of the Admin client by another thread may result in a deadlock when there is a blocking task that is waiting for a result from the cluster.

This PR adds a new ContextualExecutorProvider that instead runs the async tasks with the Quarkus executor thread pool, freeing the original thread to do additional work and avoiding a deadlock.

Signed-off-by: Michael Edgar <medgar@redhat.com>
@MikeEdgar MikeEdgar added this to the 0.12.2 milestone Apr 11, 2026
@sonarqubecloud
Copy link
Copy Markdown

@MikeEdgar MikeEdgar requested a review from a team April 11, 2026 17:16
@MikeEdgar MikeEdgar merged commit d5f28eb into streamshub:main Apr 11, 2026
7 checks passed
@MikeEdgar MikeEdgar deleted the fix-deadlock branch April 11, 2026 18:06
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.

2 participants