fix: [2.5] Remove sync task after finished (#38681) (#38687)

Cherry-pick from master
pr: #38681
Related to #38680

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/38722/head
congqixia 2024-12-24 19:02:49 +08:00 committed by GitHub
parent 18cc83b9f6
commit 91130909a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -124,6 +124,10 @@ func (mgr *syncManager) safeSubmitTask(ctx context.Context, task Task, callbacks
func (mgr *syncManager) submit(ctx context.Context, key int64, task Task, callbacks ...func(error) error) *conc.Future[struct{}] {
handler := func(err error) error {
taskKey := fmt.Sprintf("%d-%d", task.SegmentID(), task.Checkpoint().GetTimestamp())
defer func() {
mgr.tasks.Remove(taskKey)
}()
if err == nil {
return nil
}