Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/pdutil(ticdc): fix a deadlock issue #7219

Merged
merged 3 commits into from
Sep 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/pdutil/clock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add a unit test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this will fix that unstable test. So I don't think we need to add a new test.

<-c.stopCh
}

Expand Down