CNDB-15843 Capture and restore ExecutorLocals in Message.execute and Dispatcher.processInit CC5 Future callbacks that run on a different thread to access expected thread-local state. #2093
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


What is the issue
#15843: Fix access to thread-local data in Dispatcher and Message after migration from CompletableFuture to C* Future
What does this PR fix and why was it fixed
CNDB tests, like
BillingTest.testBillingWithIsolatedTenantwere failing with timeouts that are pretty generic from the driver:After debugging with ai agent help, it was discovered that the driver was timing out waiting for trace sessions in C* to complete, and the root cause that o.a.c.Future callbacks running on different threads did not have access to the correct ExecutorLocals state.
See the ticket for more details.