diff --git a/core/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java b/core/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java index 930a43fd840..b2972201808 100644 --- a/core/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java +++ b/core/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java @@ -889,7 +889,7 @@ public abstract class TransportReplicationAction { @@ -392,9 +381,9 @@ public class ShardStateAction extends AbstractComponent { * Any other exception is communicated to the requester via * this notification. * - * @param e the unexpected cause of the failure on the master + * @param t the unexpected cause of the failure on the master */ - default void onShardFailedFailure(final Exception e) { + default void onFailure(final Throwable t) { } } diff --git a/core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java b/core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java index 80ad8c766e6..901fa403ba2 100644 --- a/core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java +++ b/core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java @@ -563,8 +563,9 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent { try { if (indexShard.recoverFromStore(nodes.localNode())) { - shardStateAction.shardStarted(state, shardRouting, indexMetaData.getIndexUUID(), "after recovery from store"); + shardStateAction.shardStarted(shardRouting, indexMetaData.getIndexUUID(), "after recovery from store", SHARD_STATE_ACTION_LISTENER); } } catch (Throwable t) { handleRecoveryFailure(indexService, shardRouting, true, t); @@ -663,7 +664,7 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent exception = new AtomicReference<>(); + AtomicReference throwable = new AtomicReference<>(); LongConsumer retryLoop = requestId -> { if (randomBoolean()) { @@ -243,9 +243,9 @@ public class ShardStateActionTests extends ESTestCase { } @Override - public void onShardFailedFailure(Exception e) { + public void onFailure(Throwable t) { success.set(false); - exception.set(e); + throwable.set(t); latch.countDown(); assert false; } @@ -258,7 +258,7 @@ public class ShardStateActionTests extends ESTestCase { retryLoop.accept(capturedRequests[0].requestId); latch.await(); - assertNull(exception.get()); + assertNull(throwable.get()); assertThat(retries.get(), equalTo(numberOfRetries)); assertTrue(success.get()); } @@ -280,7 +280,7 @@ public class ShardStateActionTests extends ESTestCase { } @Override - public void onShardFailedFailure(Exception e) { + public void onFailure(Throwable t) { failure.set(true); } }); diff --git a/core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java b/core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java index 2af9cdc87a4..e9fa8e495d9 100644 --- a/core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java +++ b/core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java @@ -922,7 +922,7 @@ public class DiscoveryWithServiceDisruptionsIT extends ESIntegTestCase { } @Override - public void onShardFailedFailure(Exception e) { + public void onFailure(Throwable t) { success.set(false); latch.countDown(); assert false;