Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

These tests set closeListener racily, such that it's possible to see
it still be null in TestHttpChannel#close(). This commit replaces it
with a SubscribableListener so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in testCompletedTasks where (very
rarely) all of the client.execute calls had completed their listener
without getting to the point where they'd subscribed a closeListener.

Closes #128057

These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes elastic#128057
@DaveCTurner DaveCTurner 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. auto-backport Automatically create backport pull requests when merged v8.19.0 v9.1.0 v8.17.7 v8.18.2 v9.0.2 labels May 15, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label May 15, 2025
Copy link
Contributor

@JeremyDahlgren JeremyDahlgren left a comment

Choose a reason for hiding this comment

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

LGTM

@DaveCTurner DaveCTurner merged commit f945326 into elastic:main May 15, 2025
17 checks passed
@DaveCTurner DaveCTurner deleted the 2025/05/14/RestCancellableNodeClientTests-testConcurrentExecuteAndClose-128057 branch May 15, 2025 15:59
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request May 15, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes elastic#128057
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request May 15, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes elastic#128057
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request May 15, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes elastic#128057
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request May 15, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes elastic#128057
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.19
8.17
8.18
9.0

elasticsearchmachine pushed a commit that referenced this pull request May 15, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes #128057
elasticsearchmachine pushed a commit that referenced this pull request May 15, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes #128057
elasticsearchmachine pushed a commit that referenced this pull request May 15, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes #128057
elasticsearchmachine pushed a commit that referenced this pull request May 15, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

Closes #128057
richard-dennehy pushed a commit to richard-dennehy/elasticsearch that referenced this pull request May 19, 2025
These tests set `closeListener` racily, such that it's possible to see
it still be `null` in `TestHttpChannel#close()`. This commit replaces it
with a `SubscribableListener` so that we always complete the subscribed
listener regardless of order.

It also fixes a separate race in `testCompletedTasks` where (very
rarely) all of the `client.execute` calls had completed their listener
without getting to the point where they'd subscribed a `closeListener`.

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

Labels

auto-backport Automatically create backport pull requests when merged :Distributed Coordination/Task Management Issues for anything around the Tasks API - both persistent and node level. Team:Distributed Coordination Meta label for Distributed Coordination team >test Issues or PRs that are addressing/adding tests v8.17.7 v8.18.2 v8.19.0 v9.0.2 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] RestCancellableNodeClientTests testConcurrentExecuteAndClose failing

3 participants