Skip to content

Commit

Permalink
Wal.Sync() missing lock
Browse files Browse the repository at this point in the history
all public functions of the WAL should be covered by the mutex.

Signed-off-by: Thomas Jungblut <[email protected]>
  • Loading branch information
tjungblu committed Dec 1, 2022
1 parent bd5fbda commit 5ff9052
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/storage/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,9 @@ func (w *WAL) sync() error {
}

func (w *WAL) Sync() error {
w.mu.Lock()
defer w.mu.Unlock()

return w.sync()
}

Expand Down

0 comments on commit 5ff9052

Please sign in to comment.