The following test fails reproducibly in current `main` (af071ccc314a0975a9b6e1b6ce7d2a9f92d75a09):

    ./gradlew ':server:test' --tests "org.elasticsearch.cluster.coordination.AtomicRegisterCoordinatorTests.testClusterRecoversAfterExceptionDuringSerialization" -Dtests.seed=E6F4C7552A14BE28
server/src/main/java/org/elasticsearch/gateway/GatewayService.java
@Override
        public void clusterStateProcessed(final ClusterState oldState, final ClusterState newState) {
            logger.info("recovered [{}] indices into cluster_state", newState.metadata().indices().size());
            
            
            rerouteService.reroute("state recovered", Priority.NORMAL, ActionListener.running(GatewayService.this::resetRecoveredFlags));
        }
        @Override
        public void onFailure(final Exception e) {
            logger.log(
                MasterService.isPublishFailureException(e) ? Level.DEBUG : Level.INFO,
                () -> "unexpected failure during [" + TASK_SOURCE + "]",
                e
            );
            resetRecoveredFlags();
        }
    }
    
    TimeValue recoverAfterTime() {
        return recoverAfterTime;
    }
    private void runRecovery() {
        submitUnbatchedTask(TASK_SOURCE, new RecoverStateUpdateTask());
    }
    @SuppressForbidden(reason = "legacy usage of unbatched task") 
    private void submitUnbatchedTask(@SuppressWarnings("SameParameterValue") String source, ClusterStateUpdateTask task) {
        clusterService.submitUnbatchedStateUpdateTask(source, task);
    }
}