From 69406c213806a08be106b1c32409865d5487ed40 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Mon, 26 Sep 2022 17:19:09 +0800 Subject: [PATCH] pkg/pdutil(ticdc): fix a dead lock issue --- pkg/pdutil/clock.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/pdutil/clock.go b/pkg/pdutil/clock.go index c114b47e97c..2687bc18033 100644 --- a/pkg/pdutil/clock.go +++ b/pkg/pdutil/clock.go @@ -43,7 +43,7 @@ type clock struct { sync.RWMutex // The time encoded in PD ts. tsEventTime time.Time - // The time we receives PD ts. + // The time we receive PD ts. tsProcessingTime time.Time err error } @@ -120,8 +120,8 @@ func (c *clock) CurrentTime() (time.Time, error) { // Stop clock. func (c *clock) Stop() { c.mu.Lock() - defer c.mu.Unlock() c.cancel() + c.mu.Unlock() <-c.stopCh }