From 5f5d3d5ef057a786990c58865fe5c28f7118478f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 14 Apr 2014 19:49:48 -0700 Subject: [PATCH] core: MachineIndex more aggressively reloads data --- lib/vagrant/machine_index.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/machine_index.rb b/lib/vagrant/machine_index.rb index 42ea7328a..e396eb70b 100644 --- a/lib/vagrant/machine_index.rb +++ b/lib/vagrant/machine_index.rb @@ -108,6 +108,9 @@ module Vagrant @lock.synchronize do with_index_lock do + # Reload the data + unlocked_reload + data = find_by_prefix(uuid) return nil if !data uuid = data["id"] @@ -134,7 +137,12 @@ module Vagrant # @param [String] uuid # @return [Boolean] def include?(uuid) - !!find_by_prefix(uuid) + @lock.synchronize do + with_index_lock do + unlocked_reload + return !!find_by_prefix(uuid) + end + end end # Releases an entry, unlocking it.