Skip to content

Fix context leak in list tasks API#93431

Merged
DaveCTurner merged 4 commits intoelastic:mainfrom
DaveCTurner:2023-02-01-list-tasks-context-leak
Feb 2, 2023
Merged

Fix context leak in list tasks API#93431
DaveCTurner merged 4 commits intoelastic:mainfrom
DaveCTurner:2023-02-01-list-tasks-context-leak

Conversation

@DaveCTurner
Copy link
Copy Markdown
Member

In #90977 we made the list tasks API fully async, but failed to notice that if we waited for a task to complete then we would respond in the thread context of the last-completing task. This commit fixes the problem by restoring the context of the list-tasks task before responding.

Closes #93428

In elastic#90977 we made the list tasks API fully async, but failed to notice
that if we waited for a task to complete then we would respond in the
thread context of the last-completing task. This commit fixes the
problem by restoring the context of the list-tasks task before
responding.

Closes elastic#93428
@DaveCTurner DaveCTurner added >bug :Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. v8.7.0 labels Feb 1, 2023
@DaveCTurner DaveCTurner requested a review from arteam February 1, 2023 20:36
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team. label Feb 1, 2023
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @DaveCTurner, I've created a changelog YAML for you.

Copy link
Copy Markdown
Contributor

@arteam arteam left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks David! I will adjust the TODO line in #93375

@DaveCTurner DaveCTurner merged commit 8d44c9a into elastic:main Feb 2, 2023
@DaveCTurner DaveCTurner deleted the 2023-02-01-list-tasks-context-leak branch February 2, 2023 10:37
mark-vieira pushed a commit to mark-vieira/elasticsearch that referenced this pull request Feb 2, 2023
In elastic#90977 we made the list tasks API fully async, but failed to notice
that if we waited for a task to complete then we would respond in the
thread context of the last-completing task. This commit fixes the
problem by restoring the context of the list-tasks task before
responding.

Closes elastic#93428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. Team:Distributed Meta label for distributed team. v8.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List-tasks API response context leak

3 participants