Skip to content

Commit c41a6cf

Browse files
authored
Run FetchHealthInfoCacheAction on transport thread (elastic#139285)
The most expensive thing that `FetchHealthInfoCacheAction.TransportAction` does is `Map.copyOf` of maps that are keyed by node ID (i.e. limited size). That can run on the transport thread without any risk of blocking the thread too long. We've seen issues where the `management` thread pool on the health node is being blocked by something else, causing health logs (and API calls) to be stuck/slow. To offer a more consistent health experience, we make this action run on the transport thread instead of the management one.
1 parent 4358b88 commit c41a6cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/org/elasticsearch/health/node/FetchHealthInfoCacheAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.elasticsearch.cluster.service.ClusterService;
1919
import org.elasticsearch.common.io.stream.StreamInput;
2020
import org.elasticsearch.common.io.stream.StreamOutput;
21+
import org.elasticsearch.common.util.concurrent.EsExecutors;
2122
import org.elasticsearch.health.node.action.HealthNodeRequest;
2223
import org.elasticsearch.health.node.action.TransportHealthNodeAction;
2324
import org.elasticsearch.injection.guice.Inject;
@@ -114,7 +115,7 @@ public TransportAction(
114115
actionFilters,
115116
FetchHealthInfoCacheAction.Request::new,
116117
FetchHealthInfoCacheAction.Response::new,
117-
threadPool.executor(ThreadPool.Names.MANAGEMENT)
118+
EsExecutors.DIRECT_EXECUTOR_SERVICE
118119
);
119120
this.nodeHealthOverview = nodeHealthOverview;
120121
}

0 commit comments

Comments
 (0)