From c3151c0b8829582873dfb355f0ca5a2edcb75208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=B6ter?= Date: Wed, 3 Jun 2015 13:27:03 +0200 Subject: [PATCH] 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. --- lib/vagrant/environment.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 571ae75ab..455921485 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -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