Skip to content

Commit

Permalink
Create a new NodeRequest for every NodesDataTiersUsageTransport use
Browse files Browse the repository at this point in the history
This was previously re-using a single instance for the NodeRequest, which can cause:

```
java.lang.AssertionError: Request [ org.elasticsearch.xpack.core.datatiers.NodesDataTiersUsageTransportAction$NodeRequest/WaEyD6eiTRSJSFBG-RCLrg:2055] didn't preserve it parentTaskId
		at org.elasticsearch.server@8.14.0/org.elasticsearch.tasks.TaskManager.register(TaskManager.java:145)
		at org.elasticsearch.server@8.14.0/org.elasticsearch.tasks.TaskManager.register(TaskManager.java:117)
		at org.elasticsearch.server@8.14.0/org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:66)
		at org.elasticsearch.server@8.14.0/org.elasticsearch.transport.TransportService$6.doRun(TransportService.java:1069)
		at org.elasticsearch.server@8.14.0/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:984)
		at org.elasticsearch.server@8.14.0/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
		at java.base/java.lang.Thread.run(Thread.java:1570)
```
  • Loading branch information
dakrone committed May 7, 2024
1 parent d0f4966 commit 28fb4bd
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected NodesResponse newResponse(NodesRequest request, List<NodeDataTiersUsag

@Override
protected NodeRequest newNodeRequest(NodesRequest request) {
return NodeRequest.INSTANCE;
return new NodeRequest();
}

@Override
Expand Down Expand Up @@ -176,8 +176,6 @@ public void writeTo(StreamOutput out) throws IOException {

public static class NodeRequest extends TransportRequest {

static final NodeRequest INSTANCE = new NodeRequest();

public NodeRequest(StreamInput in) throws IOException {
super(in);
}
Expand Down

0 comments on commit 28fb4bd

Please sign in to comment.