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
waitForCounter++;
                }
            } else if (request.waitForNodes().startsWith("<")) {
                int expected = Integer.parseInt(request.waitForNodes().substring(1));
                if (response.getNumberOfNodes() < expected) {
                    waitForCounter++;
                }
            } else if (request.waitForNodes().startsWith("lt(")) {
                int expected = Integer.parseInt(request.waitForNodes().substring(3, request.waitForNodes().length() - 1));
                if (response.getNumberOfNodes() < expected) {
                    waitForCounter++;
                }
            } else {
                int expected = Integer.parseInt(request.waitForNodes());
                if (response.getNumberOfNodes() == expected) {
                    waitForCounter++;
                }
            }
        }
        return waitForCounter;
    }
    private ClusterHealthResponse clusterHealth(
        ClusterHealthRequest request,
        ClusterState clusterState,
        int numberOfPendingTasks,
        int numberOfInFlightFetch,
        TimeValue pendingTaskTimeInQueue
    ) {
        if (logger.isTraceEnabled()) {
            logger.trace("Calculating health based on state version [{}]", clusterState.version());