Skip to content

Commit a319976

Browse files
committed
Acquire read lock to present data race
1 parent ac2d5d8 commit a319976

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

db/active_replicator_common.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,9 @@ func (a *activeReplicatorCommon) getState() string {
313313
return a.state
314314
}
315315

316-
// requires a.stateErrorLock
317316
func (a *activeReplicatorCommon) _getStateWithErrorMessage() (state string, lastErrorMessage string) {
317+
a.stateErrorLock.RLock()
318+
defer a.stateErrorLock.RUnlock()
318319
if a.lastError == nil {
319320
return a.state, ""
320321
}

0 commit comments

Comments
 (0)