restore: stop bulk insert polling on context cancellation - #1158
restore: stop bulk insert polling on context cancellation#1158huanghaoyuanhhy wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: huanghaoyuanhhy The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1158 +/- ##
==========================================
+ Coverage 42.50% 42.71% +0.20%
==========================================
Files 136 134 -2
Lines 12181 12229 +48
==========================================
+ Hits 5178 5224 +46
+ Misses 6624 6611 -13
- Partials 379 394 +15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
08c7478 to
0c1f221
Compare
Signed-off-by: huanghaoyuanhhy <haoyuan.huang@zilliz.com>
0c1f221 to
aead0c3
Compare
Fixes #1157
Summary
The bulk insert state polling loops in
checkBulkInsertViaGrpcandcheckBulkInsertViaRestful(core/restore/coll_task.go) usedfor range time.Tick(...)and never checkedctx.Done()in the loop itself. Cancellation only surfaced indirectly, when the nextGetBulkInsertStateRPC failed with a context error, so a cancelled restore task kept polling for up to another poll interval (and, in a stale-success race at the moment of cancellation, longer). The loops also leaked their tickers.Changes
time.NewTickerwithselect { <-ctx.Done(); <-ticker.C }between polls, mirroring the secondary restore implementation incore/restore/secondary/coll_dml_task.goreturn errors.New(...)lines, which became unreachable (govet) once the loops were rewritten as unboundedfor {}Test plan
go test ./core/restore/passes