Do not close *lock.LockedFile on failure (#5565)

This commit is contained in:
Krishnan Parthasarathi 2018-02-22 00:58:24 +05:30 committed by kannappanr
parent 0ea54c9858
commit e5e3d17216

View File

@ -238,7 +238,6 @@ func initFormatFS(fsPath string) (rlk *lock.RLockedFile, err error) {
wlk, err := lock.TryLockedOpenFile(fsFormatPath, os.O_RDWR, 0)
if err == lock.ErrAlreadyLocked {
// Lock already present, sleep and attempt again.
wlk.Close()
time.Sleep(100 * time.Millisecond)
continue
}