github-actions[bot] commented on code in PR #66767:
URL: https://github.com/apache/doris/pull/66767#discussion_r3781765870
##########
fe/fe-core/src/main/java/org/apache/doris/qe/runtime/PipelineExecutionTask.java:
##########
@@ -97,6 +97,7 @@ public void execute() throws Exception {
if (coordinatorContext.twoPhaseExecution()) {
sendAndWaitPhaseTwoRpc();
}
+
coordinatorContext.getJobProcessor().markFragmentDispatchCompleted();
Review Comment:
[P1] Cancel already-launched fragments when dispatch exits early
Both phase helpers launch all RPC futures before `waitPipelineRpc` checks
`leftTimeMs`, but its `leftTimeMs <= 0` branch throws without the
`updateStatusIfOk`/`cancelSchedule` used by every per-future failure. For a
load, a fast top fragment can report completion after one-phase submission or
while phase-two starts are in flight; this patch records `executionFinished`,
but this success-only marker is never reached. Load callers can then unregister
or abort without cancelling the coordinator, leaving prepared or running BE
query contexts until backend timeout. Please route the expired-deadline exit
through the same real-error cancellation path before throwing and cover partial
phase-one/phase-two dispatch in a test.
##########
fe/fe-core/src/test/java/org/apache/doris/qe/AbstractJobProcessorTest.java:
##########
@@ -0,0 +1,88 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.qe;
+
+import org.apache.doris.common.Status;
+import org.apache.doris.nereids.trees.plans.distribute.worker.BackendWorker;
+import org.apache.doris.qe.runtime.MultiFragmentsPipelineTask;
+import org.apache.doris.qe.runtime.PipelineExecutionTask;
+import org.apache.doris.qe.runtime.SingleFragmentPipelineTask;
+import org.apache.doris.thrift.TReportExecStatusParams;
+
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import java.util.Collections;
+import java.util.Optional;
+
+class AbstractJobProcessorTest {
+ @Test
+ void finishBeforeFragmentDispatchDoesNotCancelPreparedFragments() {
+ MultiFragmentsPipelineTask fragmentsTask =
Mockito.mock(MultiFragmentsPipelineTask.class);
+ TestJobProcessor processor = createProcessor(fragmentsTask);
+
+ processor.tryFinishSchedule();
+ Mockito.verifyNoInteractions(fragmentsTask);
+
+ processor.markFragmentDispatchCompleted();
Review Comment:
[P2] Exercise the production phase-two boundary
These tests call `tryFinishSchedule()` and `markFragmentDispatchCompleted()`
directly while `PipelineExecutionTask` is only a mock, so they still pass if
the sole production marker call is deleted, moved before phase two, or skipped
by the load path. That means they do not reproduce the reported race. Please
drive `PipelineExecutionTask.execute()` with controllable phase-two futures:
report load completion while one start future is pending, assert no FINISHED
cleanup, complete the final start response, and then assert exactly one cleanup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]