Ignore failure when trying to delete lock file.
Deleting the lock file can fail when another process is currently trying to acquire it (-> race condition). It is safe to ignore this error since the other process will eventually acquire the lock and again try to delete the lock file.
This commit is contained in:
parent
c20624bfdc
commit
c3151c0b88
|
@ -484,7 +484,11 @@ module Vagrant
|
|||
if name != "dotlock"
|
||||
lock("dotlock", retry: true) do
|
||||
f.close
|
||||
File.delete(lock_path)
|
||||
begin
|
||||
File.delete(lock_path)
|
||||
rescue
|
||||
@logger.debug("Failed to delete lock file #{lock_path} - some other thread might be trying to acquire it -> ignoring this error")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue