Skip to content

Commit

Permalink
branch-3.0: [fix](Export) Cancel the export job when the ring buffer …
Browse files Browse the repository at this point in the history
…have no enough slot #45244 (#45430)

Cherry-picked from #45244

Co-authored-by: Tiewei Fang <[email protected]>
  • Loading branch information
github-actions[bot] and BePPPower authored Dec 17, 2024
1 parent 51997db commit 983d4c2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions fe/fe-core/src/main/java/org/apache/doris/load/ExportMgr.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,16 @@ public void addExportJobAndRegisterTask(ExportJob job) throws Exception {
job.getBrokerDesc());
}
// ATTN: Must add task after edit log, otherwise the job may finish before adding job.
for (int i = 0; i < job.getCopiedTaskExecutors().size(); i++) {
Env.getCurrentEnv().getTransientTaskManager().addMemoryTask(job.getCopiedTaskExecutors().get(i));
try {
for (int i = 0; i < job.getCopiedTaskExecutors().size(); i++) {
Env.getCurrentEnv().getTransientTaskManager().addMemoryTask(job.getCopiedTaskExecutors().get(i));
}
} catch (Exception e) {
// If there happens exceptions in `addMemoryTask`
// we must update the state of export job to `CANCELLED`
// because we have added this export in `ExportMgr`
job.updateExportJobState(ExportJobState.CANCELLED, 0L, null,
ExportFailMsg.CancelType.RUN_FAIL, e.getMessage());
}
LOG.info("add export job. {}", job);
}
Expand Down

0 comments on commit 983d4c2

Please sign in to comment.