Skip to content

Commit ddf8c84

Browse files
authored
br: fix data race for the function IsLeaseExpired (#59098)
ref #57743
1 parent 51d723b commit ddf8c84

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/domain/schema_validator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ func (s *schemaValidator) Update(leaseGrantTS uint64, oldVer, currVer int64, cha
172172
}
173173

174174
func (s *schemaValidator) IsLeaseExpired() bool {
175+
s.mux.Lock()
176+
defer s.mux.Unlock()
175177
return time.Now().After(s.latestSchemaExpire)
176178
}
177179

0 commit comments

Comments
 (0)