Skip to content

Commit 3b217b1

Browse files
committed
Revert "Add extra logging to testChildrenTasksCancelledOnTimeout (#128888)"
This reverts commit 43a9e6f.
1 parent a90aa97 commit 3b217b1

File tree

2 files changed

+4
-57
lines changed

2 files changed

+4
-57
lines changed

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ tests:
204204
- class: org.elasticsearch.packaging.test.DockerTests
205205
method: test151MachineDependentHeapWithSizeOverride
206206
issue: https://github.com/elastic/elasticsearch/issues/123437
207+
- class: org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT
208+
method: testChildrenTasksCancelledOnTimeout
209+
issue: https://github.com/elastic/elasticsearch/issues/123568
207210
- class: org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests
208211
method: testCreateAndRestorePartialSearchableSnapshot
209212
issue: https://github.com/elastic/elasticsearch/issues/123773

server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/CancellableTasksIT.java

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.elasticsearch.action.ActionRequestValidationException;
1818
import org.elasticsearch.action.ActionResponse;
1919
import org.elasticsearch.action.ActionType;
20-
import org.elasticsearch.action.DelegatingActionListener;
2120
import org.elasticsearch.action.LatchedActionListener;
2221
import org.elasticsearch.action.LegacyActionRequest;
2322
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
@@ -27,7 +26,6 @@
2726
import org.elasticsearch.action.support.PlainActionFuture;
2827
import org.elasticsearch.client.internal.node.NodeClient;
2928
import org.elasticsearch.cluster.node.DiscoveryNode;
30-
import org.elasticsearch.common.Strings;
3129
import org.elasticsearch.common.io.stream.StreamInput;
3230
import org.elasticsearch.common.io.stream.StreamOutput;
3331
import org.elasticsearch.common.util.CollectionUtils;
@@ -36,8 +34,6 @@
3634
import org.elasticsearch.common.util.set.Sets;
3735
import org.elasticsearch.core.TimeValue;
3836
import org.elasticsearch.injection.guice.Inject;
39-
import org.elasticsearch.logging.LogManager;
40-
import org.elasticsearch.logging.Logger;
4137
import org.elasticsearch.plugins.ActionPlugin;
4238
import org.elasticsearch.plugins.Plugin;
4339
import org.elasticsearch.tasks.CancellableTask;
@@ -47,7 +43,6 @@
4743
import org.elasticsearch.tasks.TaskInfo;
4844
import org.elasticsearch.tasks.TaskManager;
4945
import org.elasticsearch.test.ESIntegTestCase;
50-
import org.elasticsearch.test.junit.annotations.TestIssueLogging;
5146
import org.elasticsearch.threadpool.ThreadPool;
5247
import org.elasticsearch.transport.ReceiveTimeoutTransportException;
5348
import org.elasticsearch.transport.SendRequestTransportException;
@@ -79,9 +74,6 @@
7974
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST)
8075
public class CancellableTasksIT extends ESIntegTestCase {
8176

82-
// Temporary addition for investigation into https://github.com/elastic/elasticsearch/issues/123568
83-
private static final Logger logger = LogManager.getLogger(CancellableTasksIT.class);
84-
8577
static int idGenerator = 0;
8678
static final Map<TestRequest, CountDownLatch> beforeSendLatches = ConcurrentCollections.newConcurrentMap();
8779
static final Map<TestRequest, CountDownLatch> arrivedLatches = ConcurrentCollections.newConcurrentMap();
@@ -374,42 +366,18 @@ public void testRemoveBanParentsOnDisconnect() throws Exception {
374366
}
375367
}
376368

377-
@TestIssueLogging(
378-
issueUrl = "https://github.com/elastic/elasticsearch/issues/123568",
379-
value = "org.elasticsearch.transport.TransportService.tracer:TRACE"
380-
+ ",org.elasticsearch.tasks.TaskManager:TRACE"
381-
+ ",org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT:DEBUG"
382-
)
383369
public void testChildrenTasksCancelledOnTimeout() throws Exception {
384370
Set<DiscoveryNode> nodes = clusterService().state().nodes().stream().collect(Collectors.toSet());
385371
final TestRequest rootRequest = generateTestRequest(nodes, 0, between(1, 4), true);
386-
logger.info("generated request\n{}", buildTestRequestDescription(rootRequest, "", new StringBuilder()).toString());
387372
ActionFuture<TestResponse> rootTaskFuture = client().execute(TransportTestAction.ACTION, rootRequest);
388-
logger.info("action executed");
389373
allowEntireRequest(rootRequest);
390-
logger.info("execution released");
391374
waitForRootTask(rootTaskFuture, true);
392-
logger.info("root task completed");
393375
ensureBansAndCancellationsConsistency();
394-
logger.info("ensureBansAndCancellationsConsistency completed");
395376

396377
// Make sure all descendent requests have completed
397378
for (TestRequest subRequest : rootRequest.descendants()) {
398-
logger.info("awaiting completion of request {}", subRequest.getDescription());
399379
safeAwait(completedLatches.get(subRequest));
400380
}
401-
logger.info("all requests completed");
402-
}
403-
404-
// Temporary addition for investigation into https://github.com/elastic/elasticsearch/issues/123568
405-
static StringBuilder buildTestRequestDescription(TestRequest request, String prefix, StringBuilder stringBuilder) {
406-
stringBuilder.append(prefix)
407-
.append(Strings.format("id=%d [timeout=%s] %s", request.id, request.timeout, request.node.descriptionWithoutAttributes()))
408-
.append('\n');
409-
for (TestRequest subRequest : request.subRequests) {
410-
buildTestRequestDescription(subRequest, prefix + " ", stringBuilder);
411-
}
412-
return stringBuilder;
413381
}
414382

415383
static TaskId getRootTaskId(TestRequest request) throws Exception {
@@ -538,8 +506,6 @@ public void writeTo(StreamOutput out) throws IOException {
538506

539507
public static class TransportTestAction extends HandledTransportAction<TestRequest, TestResponse> {
540508

541-
private static final Logger logger = CancellableTasksIT.logger;
542-
543509
public static ActionType<TestResponse> ACTION = new ActionType<>("internal::test_action");
544510
private final TransportService transportService;
545511
private final NodeClient client;
@@ -599,22 +565,7 @@ protected void doExecute(Task task, TestRequest request, ActionListener<TestResp
599565
protected void startSubTask(TaskId parentTaskId, TestRequest subRequest, ActionListener<TestResponse> listener) {
600566
subRequest.setParentTask(parentTaskId);
601567
CountDownLatch completeLatch = completedLatches.get(subRequest);
602-
ActionListener<TestResponse> latchedListener = new DelegatingActionListener<>(
603-
new LatchedActionListener<>(listener, completeLatch)
604-
) {
605-
// Temporary logging addition for investigation into https://github.com/elastic/elasticsearch/issues/123568
606-
@Override
607-
public void onResponse(TestResponse testResponse) {
608-
logger.debug("processing successful response to request [{}]", subRequest.getDescription());
609-
delegate.onResponse(testResponse);
610-
}
611-
612-
@Override
613-
public void onFailure(Exception e) {
614-
logger.debug("processing exceptional response to request [{}]: {}", subRequest.getDescription(), e.getMessage());
615-
super.onFailure(e);
616-
}
617-
};
568+
LatchedActionListener<TestResponse> latchedListener = new LatchedActionListener<>(listener, completeLatch);
618569
transportService.getThreadPool().generic().execute(new AbstractRunnable() {
619570
@Override
620571
public void onFailure(Exception e) {
@@ -645,13 +596,6 @@ protected void doRun() throws Exception {
645596
TransportResponseHandler.TRANSPORT_WORKER
646597
)
647598
);
648-
// Temporary addition for investigation into https://github.com/elastic/elasticsearch/issues/123568
649-
logger.debug(
650-
"sent test request [{}] from [{}] to [{}]",
651-
subRequest.getDescription(),
652-
client.getLocalNodeId(),
653-
subRequest.node.descriptionWithoutAttributes()
654-
);
655599
}
656600
}
657601
});

0 commit comments

Comments
 (0)