executor: allow canceling import job without dxf task#69659
Conversation
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe executor's import job cancellation logic now handles the case where the DXF distributed task cannot be found by falling back to direct job cancellation via a new helper function. A corresponding test and Bazel dependency were added. ChangesImport Job Cancellation Fallback
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Executor
participant TaskManager
participant DXFStorage
participant Importer
Executor->>TaskManager: CancelTaskByKeySession(taskKey)
Executor->>TaskManager: WaitTaskDoneByKey(taskKey)
TaskManager->>DXFStorage: lookup task
DXFStorage-->>TaskManager: ErrTaskNotFound
TaskManager-->>Executor: return error
Executor->>Executor: cancelImportJobOnly()
Executor->>Importer: CancelJob()
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="Running error: context loading failed: failed to load packages: failed to load packages: failed to load with go/packages: context deadline exceeded" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-nextgen-202603 #69659 +/- ##
===========================================================
Coverage ? 76.1800%
===========================================================
Files ? 1935
Lines ? 540492
Branches ? 0
===========================================================
Hits ? 411747
Misses ? 128745
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
What problem does this PR solve?
Issue Number: ref #61702
Problem Summary:
In nextgen user keyspace, IMPORT INTO creates the import job row before submitting the corresponding DXF task in a separate transaction. If the submission fails after the import job is created but before the DXF task is created,
CANCEL IMPORT JOBfails withtask not foundand leaves the import job active.What changed and how does it work?
When canceling an import job, keep the normal DXF task cancellation path. If waiting by the import task key reports
storage.ErrTaskNotFound, treat it as the orphaned pre-DXF-submit case and update the import job state directly withimporter.CancelJob.A regression test creates an import job without a matching DXF task and verifies
CANCEL IMPORT JOBmarks the job ascancelled.Check List
Tests
Side effects
Documentation
Release note
Tests
Summary by CodeRabbit
Bug Fixes
Tests