Skip to content

Commit 6b7191e

Browse files
Move ClusterApplierService assertion after logging exception
1 parent 785803b commit 6b7191e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,6 @@ private void runTask(String source, Function<ClusterState, ClusterState> updateF
469469
);
470470
warnAboutSlowTaskIfNeeded(executionTime, source, stopWatch);
471471
} catch (Exception e) {
472-
// failing to apply a cluster state with an exception indicates a bug in validation or in one of the appliers; if we
473-
// continue we will retry with the same cluster state but that might not help.
474-
assert applicationMayFail();
475472
timedListener.onFailure(e);
476473
TimeValue executionTime = getTimeSince(startTimeMillis);
477474
if (logger.isTraceEnabled()) {
@@ -492,6 +489,9 @@ private void runTask(String source, Function<ClusterState, ClusterState> updateF
492489
e
493490
);
494491
}
492+
// failing to apply a cluster state with an exception indicates a bug in validation or in one of the appliers; if we
493+
// continue we will retry with the same cluster state but that might not help.
494+
assert applicationMayFail();
495495
} finally {
496496
clearIsApplyingClusterState();
497497
}

0 commit comments

Comments
 (0)