Skip to content
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

Busy wait until all tasks are removed #95494

Merged
merged 3 commits into from
Apr 25, 2023
Merged

Conversation

arteam
Copy link
Contributor

@arteam arteam commented Apr 24, 2023

There's a small delay between we release the main task and all the tasks actually get removed from the task manager, make sure we don't fail the test immediately, but busy wait a bit.

Fixes #95425

There's a small delay between we release the main task and all the tasks actually
get removed from the task manager, make sure we don't fail the test immediately,
but busy wait a bit.
@arteam arteam added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. labels Apr 24, 2023
@arteam
Copy link
Contributor Author

arteam commented Apr 24, 2023

@elasticmachine update branch

@arteam arteam marked this pull request as ready for review April 24, 2023 12:52
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Apr 24, 2023
@elasticsearchmachine
Copy link
Collaborator

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

@original-brownbear
Copy link
Member

Do we know why this started failing?

@pxsalehi
Copy link
Member

pxsalehi commented Apr 24, 2023

I wonder if this is also related to #94987 (comment).

@arteam
Copy link
Contributor Author

arteam commented Apr 24, 2023

Yeah, it's definitely related to #94987 (comment)

@arteam
Copy link
Contributor Author

arteam commented Apr 24, 2023

There have been a few task related test failures due to #94865

Copy link
Member

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM makes sense with the change to when we remove a task.

try {
assertBusy(() -> assertEquals(0, node.transportService.getTaskManager().getTasks().size()));
} catch (Exception e) {
throw new RuntimeException(e);
Copy link
Member

Choose a reason for hiding this comment

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

NIT: Maybe just add throws Exception to this method and all its callers? :)

@arteam arteam merged commit 9d9967c into elastic:main Apr 25, 2023
@arteam arteam deleted the busy-wait-task-count branch April 25, 2023 09:19
arteam added a commit to arteam/elasticsearch that referenced this pull request Apr 26, 2023
Due to elastic#94865, we now send an ack before the task gets removed, so we can see
a non-zero amount of tasks in the task manager for a short amount of time.

We can just busy wait until the task gets removed.

See elastic#95494, elastic#94987
arteam added a commit that referenced this pull request May 9, 2023
* Fix TasksIT.testTasksUnblocking

Due to #94865, we now send an ack before the task gets removed, so we can see
a non-zero amount of tasks in the task manager for a short amount of time.

We can just busy wait until the task gets removed.

See #95494, #94987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. >test Issues or PRs that are addressing/adding tests v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] TransportTasksActionTests testRunningTasksCount failing
5 participants