-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix TransportDesiredNodesActionsIT batch tests #83406
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
Select the current master to submit the blocking cluster state update task. Closes elastic#83386
Pinging @elastic/es-distributed (Team:Distributed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I left another suggestion too.
@@ -372,7 +370,7 @@ private UpdateDesiredNodesResponse updateDesiredNodes(DesiredNodes desiredNodes) | |||
private Runnable blockClusterStateUpdateThread() throws InterruptedException { | |||
final CountDownLatch unblockClusterStateUpdateTask = new CountDownLatch(1); | |||
final CountDownLatch blockingClusterStateUpdateTaskExecuting = new CountDownLatch(1); | |||
final ClusterService clusterService = internalCluster().getMasterNodeInstance(ClusterService.class); | |||
final ClusterService clusterService = internalCluster().getCurrentMasterNodeInstance(ClusterService.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API is so trappy. I opened #83407.
@@ -383,7 +381,8 @@ public ClusterState execute(ClusterState currentState) throws Exception { | |||
|
|||
@Override | |||
public void onFailure(Exception e) { | |||
|
|||
blockingClusterStateUpdateTaskExecuting.countDown(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend also bounding the wait time (assertTrue(blockingClusterStateUpdateTaskExecuting.await(10, TimeUnit.SECONDS));
and similarly for unblockClusterStateUpdateTask
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM2
Select the current master to submit the blocking cluster state update task, otherwise the task never gets executed. Closes elastic#83386
💚 Backport successful
|
Select the current master to submit the blocking cluster state
update task, otherwise the task never gets executed.
Closes #83386