Skip to content

Fix race condition in RestCancellableNodeClient #126703

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

Conversation

DaveCTurner
Copy link
Contributor

Today we rely on registering the channel after registering the task to
be cancelled to ensure that the task is cancelled even if the channel is
closed concurrently. However the client may already have processed a
cancellable request on the channel and therefore this mechanism doesn't
work. With this change we make sure not to register another task after
draining the registrations in order to cancel them.

Closes #88201

Backport of #126686 to 7.17

Today we rely on registering the channel after registering the task to
be cancelled to ensure that the task is cancelled even if the channel is
closed concurrently. However the client may already have processed a
cancellable request on the channel and therefore this mechanism doesn't
work. With this change we make sure not to register another task after
draining the registrations in order to cancel them.

Closes elastic#88201

Backport of elastic#126686 to `7.17`
@DaveCTurner DaveCTurner added >bug :Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v7.17.29 labels Apr 11, 2025
@elasticsearchmachine elasticsearchmachine merged commit efac590 into elastic:7.17 Apr 11, 2025
10 checks passed
@DaveCTurner DaveCTurner deleted the 2025/04/11/RestCancellableNodeClient-reuse-bug-backport-717 branch April 11, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. v7.17.29
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants