diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/tasks/TransportPendingClusterTasksAction.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/tasks/TransportPendingClusterTasksAction.java index 29b18db8500..105d596bad8 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/tasks/TransportPendingClusterTasksAction.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/tasks/TransportPendingClusterTasksAction.java @@ -27,11 +27,14 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; +import org.elasticsearch.cluster.service.PendingClusterTask; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; +import java.util.List; + /** */ public class TransportPendingClusterTasksAction extends TransportMasterNodeReadAction { @@ -63,6 +66,9 @@ public class TransportPendingClusterTasksAction extends TransportMasterNodeReadA @Override protected void masterOperation(PendingClusterTasksRequest request, ClusterState state, ActionListener listener) { - listener.onResponse(new PendingClusterTasksResponse(clusterService.pendingTasks())); + logger.trace("fetching pending tasks from cluster service"); + final List pendingTasks = clusterService.pendingTasks(); + logger.trace("done fetching pending tasks from cluster service"); + listener.onResponse(new PendingClusterTasksResponse(pendingTasks)); } } diff --git a/core/src/test/java/org/elasticsearch/cluster/ClusterServiceIT.java b/core/src/test/java/org/elasticsearch/cluster/ClusterServiceIT.java index cc3cae8606b..f5c99fd5f7e 100644 --- a/core/src/test/java/org/elasticsearch/cluster/ClusterServiceIT.java +++ b/core/src/test/java/org/elasticsearch/cluster/ClusterServiceIT.java @@ -504,6 +504,7 @@ public class ClusterServiceIT extends ESIntegTestCase { assertThat(processedLatch.await(1, TimeUnit.SECONDS), equalTo(true)); } + @TestLogging("_root:debug,action.admin.cluster.tasks:trace") public void testPendingUpdateTask() throws Exception { Settings settings = settingsBuilder() .put("discovery.type", "local")