From 636e107e449c43b2a654633cd850a95406910b65 Mon Sep 17 00:00:00 2001 From: congqixia Date: Tue, 24 Dec 2024 13:34:48 +0800 Subject: [PATCH] fix: Remove sync task after finished (#38681) Related to #38680 Signed-off-by: Congqi Xia --- internal/flushcommon/syncmgr/sync_manager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/flushcommon/syncmgr/sync_manager.go b/internal/flushcommon/syncmgr/sync_manager.go index e02611812ef9a..da0ee0e99a0da 100644 --- a/internal/flushcommon/syncmgr/sync_manager.go +++ b/internal/flushcommon/syncmgr/sync_manager.go @@ -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 }