mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
wal: log errors in wal.Close()
This patch adds error logging in wal.Close() if unlocking and destroying fail. Though it is hard to handling the errors, logging would be helpful for trouble shooting.
This commit is contained in:
parent
718a42f408
commit
ba76e27875
11
wal/wal.go
11
wal/wal.go
@ -449,9 +449,14 @@ func (w *WAL) Close() error {
|
||||
}
|
||||
}
|
||||
for _, l := range w.locks {
|
||||
// TODO: log the error
|
||||
l.Unlock()
|
||||
l.Destroy()
|
||||
err := l.Unlock()
|
||||
if err != nil {
|
||||
plog.Errorf("failed to unlock during closing wal: %s", err)
|
||||
}
|
||||
err = l.Destroy()
|
||||
if err != nil {
|
||||
plog.Errorf("failed to destroy lock during closing wal: %s", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user