From a3d7474ae045976fae639bf6105162f392b145f3 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 14 Aug 2020 11:03:16 +0800 Subject: [PATCH] fix data race --- core/executors/periodicalexecutor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/executors/periodicalexecutor.go b/core/executors/periodicalexecutor.go index a6d8c382445b..7db54a5d4ee2 100644 --- a/core/executors/periodicalexecutor.go +++ b/core/executors/periodicalexecutor.go @@ -139,9 +139,7 @@ func (pe *PeriodicalExecutor) executeTasks(tasks interface{}) bool { pe.wgBarrier.Guard(func() { pe.waitGroup.Add(1) }) - defer pe.wgBarrier.Guard(func() { - pe.waitGroup.Done() - }) + defer pe.waitGroup.Done() ok := pe.hasTasks(tasks) if ok {