In https://github.com/elastic/elasticsearch/pull/90621 we moved most usages of the cluster health API onto a `MANAGEMENT` thread because it's too expensive to run on `SAME` in a large cluster. However, if the request includes any `wait_for_*` option then we set up a cluster state observer, which supplies its responses on the cluster applier thread. We need to fork those computations onto a `MANAGEMENT` thread too.
server/src/main/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthAction.java
}
    @SuppressForbidden(reason = "legacy usage of unbatched task") 
    private void submitUnbatchedTask(@SuppressWarnings("SameParameterValue") String source, ClusterStateUpdateTask task) {
        clusterService.submitUnbatchedStateUpdateTask(source, task);
    }
    private void executeHealth(
        final CancellableTask task,
        final ClusterHealthRequest request,
        final ClusterState currentState,
        final ActionListener<ClusterHealthResponse> listener,
        final int waitCount,
        final Consumer<ClusterState> onNewClusterStateAfterDelay
    ) {
        if (task.notifyIfCancelled(listener)) {
            return;
        }
        if (request.timeout().millis() == 0) {
            sendResponse(task, request, currentState, waitCount, TimeoutState.ZERO_TIMEOUT, listener);
            return;
        }
        final Predicate<ClusterState> validationPredicate = newState -> validateRequest(request, newState, waitCount);
        if (validationPredicate.test(currentState)) {
            sendResponse(task, request, currentState, waitCount, TimeoutState.OK, listener);
        } else {
            final ClusterStateObserver observer = new ClusterStateObserver(
                currentState,
                clusterService,
                null,
                logger,
                threadPool.getThreadContext()