Skip to content

Conversation

@robobario
Copy link
Member

@robobario robobario commented Dec 11, 2025

Type of change

  • bandaid

Description

Our dream was that we could guarantee that chained work is executed on the filter dispatch executor. However in the empty case we complete extremely quickly so there is a possibility that work chained on to filterContext.topicNames(xyz) will execute in the calling thread, not the filter dispatch thread.

We need to decide if we take things further, like implementing our own CompletionStage with a different execution guarantee than CompletableFuture. Or we could rely on javadoc to let developers know that if they call topicNames from an uncontrolled thread, they will need to switch back to the filterDispatchExecutor to mutate filter members safely using a then*Async method of the CompletionStage.

See #3045

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • PR raised from a fork of this repository and made from a branch rather than main.
  • Write tests
  • Update documentation
  • Make sure all unit/integration tests pass
  • Make sure all Sonarcloud warnings are addressed or are justifiably ignored.
  • If applicable to the change, trigger the system test suite. Make sure tests pass.
  • If applicable to the change, trigger the performance test suite. Ensure that any degradations to performance numbers are understood and justified.
  • Ensure the PR references relevant issue(s) so they are closed on merging.
  • For user facing changes, update CHANGELOG.md (remember to include changes affecting the API of the test artefacts too).

NOTE: You must be a member of @kroxylicious/developers to trigger the system test and performance test suites. If you are not part of this group, comment on the PR requesting a trigger, tagging @kroxylicious/developers.

Our dream was that we could guarantee that chained work is executed on
the filter dispatch executor. However in the empty case we complete
extremely quickly so there is a possibility that work chained on to
filterContext.topicNames(xyz) will execute in the calling thread, not
the filter dispatch thread.

We need to decide if we take things further, like implementing our own
CompletionStage with a different execution guarantee than
CompletableFuture. Or we could rely on javadoc to let developers know that
if they call topicNames from an uncontrolled thread, they will need to
switch back to the filterDispatchExecutor to mutate filter members
safely using a then*Async method of the CompletionStage.

Signed-off-by: Robert Young <robertyoungnz@gmail.com>
@robobario robobario requested a review from a team as a code owner December 11, 2025 20:32
@sonarqubecloud
Copy link

Copy link
Member

@SamBarker SamBarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stable build FTW

@SamBarker SamBarker merged commit f09297d into kroxylicious:main Dec 11, 2025
11 checks passed
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