Skip to content

Commit 26a7719

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent d88b476 commit 26a7719

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

server/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -681,32 +681,28 @@ private final class AsyncReplicaAction extends AbstractRunnable implements Actio
681681
public void onResponse(Releasable releasable) {
682682
assert replica.getActiveOperationsCount() != 0 : "must perform shard operation under a permit";
683683
try {
684-
shardOperationOnReplica(
685-
replicaRequest.getRequest(),
686-
replica,
687-
ActionListener.wrap((replicaResult) -> {
688-
final var response = new ReplicaResponse(replica.getLocalCheckpoint(), replica.getLastSyncedGlobalCheckpoint());
689-
replicaResult.runPostReplicaActions(ActionListener.wrap(r -> {
690-
releasable.close(); // release shard operation lock before responding to caller
691-
if (logger.isTraceEnabled()) {
692-
logger.trace(
693-
"action [{}] completed on shard [{}] for request [{}]",
694-
transportReplicaAction,
695-
replicaRequest.getRequest().shardId(),
696-
replicaRequest.getRequest()
697-
);
698-
}
699-
setPhase(task, "finished");
700-
onCompletionListener.onResponse(response);
701-
}, e -> {
702-
Releasables.closeWhileHandlingException(releasable); // release shard operation lock before responding to caller
703-
responseWithFailure(e);
704-
}));
684+
shardOperationOnReplica(replicaRequest.getRequest(), replica, ActionListener.wrap((replicaResult) -> {
685+
final var response = new ReplicaResponse(replica.getLocalCheckpoint(), replica.getLastSyncedGlobalCheckpoint());
686+
replicaResult.runPostReplicaActions(ActionListener.wrap(r -> {
687+
releasable.close(); // release shard operation lock before responding to caller
688+
if (logger.isTraceEnabled()) {
689+
logger.trace(
690+
"action [{}] completed on shard [{}] for request [{}]",
691+
transportReplicaAction,
692+
replicaRequest.getRequest().shardId(),
693+
replicaRequest.getRequest()
694+
);
695+
}
696+
setPhase(task, "finished");
697+
onCompletionListener.onResponse(response);
705698
}, e -> {
706699
Releasables.closeWhileHandlingException(releasable); // release shard operation lock before responding to caller
707-
AsyncReplicaAction.this.onFailure(e);
708-
})
709-
);
700+
responseWithFailure(e);
701+
}));
702+
}, e -> {
703+
Releasables.closeWhileHandlingException(releasable); // release shard operation lock before responding to caller
704+
AsyncReplicaAction.this.onFailure(e);
705+
}));
710706
// TODO: Evaluate if we still need to catch this exception
711707
} catch (Exception e) {
712708
Releasables.closeWhileHandlingException(releasable); // release shard operation lock before responding to caller

0 commit comments

Comments
 (0)