Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77d23dc

Browse files
committed
Fix race when closing replica sync
1 parent d7d50db commit 77d23dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

enterprise/replicasync/replicasync.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ func (m *Manager) Close() error {
362362
m.closeCancel()
363363
m.closeWait.Wait()
364364
m.closeMutex.Unlock()
365-
365+
m.mutex.Lock()
366+
defer m.mutex.Unlock()
366367
ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)
367368
defer cancelFunc()
368369
_, err := m.db.UpdateReplica(ctx, database.UpdateReplicaParams{

0 commit comments

Comments
 (0)