|
13 | 13 | import org.elasticsearch.action.ActionListener;
|
14 | 14 | import org.elasticsearch.action.StepListener;
|
15 | 15 | import org.elasticsearch.action.support.ActionFilters;
|
| 16 | +import org.elasticsearch.action.support.ThreadedActionListener; |
16 | 17 | import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
17 | 18 | import org.elasticsearch.client.internal.node.NodeClient;
|
18 | 19 | import org.elasticsearch.cluster.ClusterState;
|
@@ -90,7 +91,7 @@ public TransportSnapshotsStatusAction(
|
90 | 91 | SnapshotsStatusRequest::new,
|
91 | 92 | indexNameExpressionResolver,
|
92 | 93 | SnapshotsStatusResponse::new,
|
93 |
| - ThreadPool.Names.SAME |
| 94 | + ThreadPool.Names.SNAPSHOT_META // building the response is somewhat expensive for large snapshots so we fork |
94 | 95 | );
|
95 | 96 | this.repositoriesService = repositoriesService;
|
96 | 97 | this.client = client;
|
@@ -141,16 +142,22 @@ protected void masterOperation(
|
141 | 142 | TransportNodesSnapshotsStatus.TYPE,
|
142 | 143 | new TransportNodesSnapshotsStatus.Request(nodesIds.toArray(Strings.EMPTY_ARRAY)).snapshots(snapshots)
|
143 | 144 | .timeout(request.masterNodeTimeout()),
|
144 |
| - ActionListener.wrap( |
145 |
| - nodeSnapshotStatuses -> buildResponse( |
146 |
| - snapshotsInProgress, |
147 |
| - request, |
148 |
| - currentSnapshots, |
149 |
| - nodeSnapshotStatuses, |
150 |
| - cancellableTask, |
151 |
| - listener |
| 145 | + new ThreadedActionListener<>( |
| 146 | + logger, |
| 147 | + threadPool, |
| 148 | + ThreadPool.Names.SNAPSHOT_META, // fork to snapshot meta since building the response is expensive for large snapshots |
| 149 | + ActionListener.wrap( |
| 150 | + nodeSnapshotStatuses -> buildResponse( |
| 151 | + snapshotsInProgress, |
| 152 | + request, |
| 153 | + currentSnapshots, |
| 154 | + nodeSnapshotStatuses, |
| 155 | + cancellableTask, |
| 156 | + listener |
| 157 | + ), |
| 158 | + listener::onFailure |
152 | 159 | ),
|
153 |
| - listener::onFailure |
| 160 | + false |
154 | 161 | )
|
155 | 162 | );
|
156 | 163 | } else {
|
|
0 commit comments