Skip to content

Commit

Permalink
Avoid leaking blackholed register ops in tests (#114287)
Browse files Browse the repository at this point in the history
Today when we reboot a node in a test case derived from
`AbstractCoordinatorTestCase` we lose the contents of
`blackholedRegisterOperations`, but it's important that these operations
_eventually_ run. With this commit we copy these operations over into
the new node.
  • Loading branch information
DaveCTurner authored Oct 9, 2024
1 parent e676f6b commit 276f3b8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ ClusterNode restartedNode(
.roles(localNode.isMasterNode() && DiscoveryNode.isMasterNode(settings) ? ALL_ROLES_EXCEPT_VOTING_ONLY : emptySet())
.build();
try {
return new ClusterNode(
final var restartedNode = new ClusterNode(
nodeIndex,
newLocalNode,
(node, threadPool) -> createPersistedStateFromExistingState(
Expand All @@ -1263,6 +1263,8 @@ ClusterNode restartedNode(
settings,
nodeHealthService
);
restartedNode.blackholedRegisterOperations.addAll(blackholedRegisterOperations);
return restartedNode;
} finally {
clearableRecycler.clear();
}
Expand Down

0 comments on commit 276f3b8

Please sign in to comment.