Skip to content

Fix race condition in RequestExecutor creation - #8674

Merged
tobias-tengler merged 1 commit into
mainfrom
tte/fix-executor-race-condition
Sep 5, 2025
Merged

tobias-tengler merged 1 commit into
mainfrom
tte/fix-executor-race-condition

Conversation

@tobias-tengler

@tobias-tengler tobias-tengler commented Sep 5, 2025 •

Copy link
Copy Markdown
Member

If two requests come in roughly at the same time. The first request enters the lock to create the request executor.
Once the exeuctor is constructed it's being assigned to the CurrentExecutor property.
The second request can now already take the executor without waiting for the lock i.e. the construction to finish.
That's unfortunate, since the OnConfigureRequestExecutor is run after the property assignment, so the ExecutorSession might not yet have been associated with the executor, when the second request already tries to use the executor.

This PR fixes this, by simply moving the OnConfigureRequestExecutor before the CurrentExecutor assignment.

@tobias-tengler
tobias-tengler merged commit 4432f71 into main Sep 5, 2025
110 checks passed
@tobias-tengler
tobias-tengler deleted the tte/fix-executor-race-condition branch September 5, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant