diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java index 956c40c633..3bb816e857 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java @@ -587,7 +587,7 @@ public class Coordinator { this.timeoutDeadline = System.currentTimeMillis() + queryOptions.getExecutionTimeout() * 1000L; if (topDataSink instanceof ResultSink || topDataSink instanceof ResultFileSink) { TNetworkAddress execBeAddr = topParams.instanceExecParams.get(0).host; - receiver = new ResultReceiver(topParams.instanceExecParams.get(0).instanceId, + receiver = new ResultReceiver(queryId, topParams.instanceExecParams.get(0).instanceId, addressToBackendID.get(execBeAddr), toBrpcHost(execBeAddr), this.timeoutDeadline); if (LOG.isDebugEnabled()) { LOG.debug("dispatch query job: {} to {}", DebugUtil.printId(queryId), diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ResultReceiver.java b/fe/fe-core/src/main/java/org/apache/doris/qe/ResultReceiver.java index ce34099245..9a5e2f673e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/ResultReceiver.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ResultReceiver.java @@ -45,11 +45,13 @@ public class ResultReceiver { private long packetIdx = 0; private long timeoutTs = 0; private TNetworkAddress address; + private Types.PUniqueId queryId; private Types.PUniqueId finstId; private Long backendId; private Thread currentThread; - public ResultReceiver(TUniqueId tid, Long backendId, TNetworkAddress address, long timeoutTs) { + public ResultReceiver(TUniqueId queryId, TUniqueId tid, Long backendId, TNetworkAddress address, long timeoutTs) { + this.queryId = Types.PUniqueId.newBuilder().setHi(queryId.hi).setLo(queryId.lo).build(); this.finstId = Types.PUniqueId.newBuilder().setHi(tid.hi).setLo(tid.lo).build(); this.backendId = backendId; this.address = address; @@ -75,13 +77,13 @@ public class ResultReceiver { while (pResult == null) { long currentTs = System.currentTimeMillis(); if (currentTs >= timeoutTs) { - throw new TimeoutException("query timeout"); + throw new TimeoutException("query timeout, query id = " + DebugUtil.printId(this.queryId)); } try { pResult = future.get(timeoutTs - currentTs, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { // continue to get result - LOG.info("future get interrupted Exception"); + LOG.info("future get interrupted Exception", e); if (isCancel) { status.setStatus(Status.CANCELLED); return null;