Repository navigation
fix(frontend): preserve cancellation errors during LOCAL uploads - #33053
Conversation
Close the producer end of the upload pipe with the cancellation error. This wakes both endpoints and delivers the existing query-interruption error to the statement consumer while the upload owner drains the connection. Signed-off-by: XuPeng-SH <[email protected]>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
This pull request is merged. |
|
mo-bot review · Commit: "interrupted" |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 969ad088725aba963d9f18f46a6e48b1ea3e97a3
Assessment: approve
Closing the upload pipe writer delivers cancellation to the SQL reader. The existing error mapping returns MySQL 1317, and the upload owner drains the finite client stream before the connection is reused. The wire tests verified rollback and session reuse.
Model: gpt-6.2-sol / xhigh
Session: 01a1f0a0-5126-78f3-9ab8-ef4e87f2f119 · slot 0 · generation 3
Validation:
-
The target-base control reproduced io.ErrClosedPipe at the new regression assertion. See frontend-drain-base-control.jsonl and checks/1795320251180987094-2.json.
-
Focused frontend tests and all seven one-CN TestKillLoadLocal wire scenarios passed with race detection and coverage. See focused-race-cover.jsonl and checks/1795320271954009620-2.json.
-
The frontend cancellation regression passed 30 repetitions, and the partial-payload wire case passed 16 repetitions, with race detection and coverage. See checks/1795320326945862187-2.json and checks/1795320345062280563-2.json.
-
The frontend package passed in short mode with race detection and coverage. See frontend-package-race-cover.jsonl and checks/1795320361589481582-2.json.
Limitations:
- The frontend package run excluded Test_openNewFile_nilCtx because that fixture writes inside the read-only checkout. Short mode also skipped TestRuleCacheDoubleCheckLocking.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #31475 and #31703. The failing coverage test was observed on #32914.
What this PR does / why we need it:
When KILL QUERY interrupted a
LOAD DATA LOCALupload, closing the pipe reader caused the SQL consumer to seeio.ErrClosedPipe. The client could receive MySQL error 1105 for the interrupted query.Close the upload pipe writer with the cancellation error so the consumer receives it and the existing protocol mapping returns MySQL error 1317 / SQLSTATE 70100. The upload owner still drains a finite client stream before the session is reused. The regression captures the consumer error while the finite tail is pending and checks it after the upload owner has joined.
Validation
io.ErrClosedPipeon clean main at96d0d01872.TestKillLoadLocalwire scenarios passed under race and 12 times each with coverage enabled.