vagrant-lxc-ng/lib/vagrant-lxc
Ray Ruvinskiy dc55c914e4 Work around WaitForCommunicator lock race condition
The LXC provider issues the "fetch_ip" action to look up the IP address
of the container as part of its "ssh_info" action.
Vagrant::LXC::Action.action_fetch_ip checks the machine state using
Builtin::IsState, which calls Vagrant::Machine.state, which also updates
the state in the machine index and acquires a machine index entry lock to do that.
A race condition ensues in WaitForCommunicator.call, where ready_thr tries
to acquire the machine index lock while running ssh_info, and states_thr tries
to acquire the same lock doing its own state look up (env[:machine].state.id).
If they both try to acquire the lock at the same time, one will fail, and
an exception will be raised.

Work around this issue by checking for the desired machine state (:running) in
Vagrant::LXC::Provider.ssh_info, which can get the state from
Vagrant::LXC::Provider.state, which in turn does not write out the state into
the index file and does not acquire the index entry lock.
2014-09-29 16:47:29 -04:00
..
action action/fetch_ip_with_lxc_attach: Attach to the MOUNT namespace in order to fix GH-300 2014-07-24 21:58:04 -03:00
backports/action core: "Tag" ShareFolders action as backport functionality 2014-03-13 00:57:36 -03:00
command Remove version suffix from generated sudoers commands 2014-09-22 23:07:12 -03:00
driver driver: Remove calls to in favor of Vagrant's built in graceful halt 2014-07-24 21:58:04 -03:00
provider/cap core: Introduce a public_address capability so that we can use vagrant share 2014-03-13 00:57:36 -03:00
action.rb Work around WaitForCommunicator lock race condition 2014-09-29 16:47:29 -04:00
config.rb config: Switch default backingstore to "best" [GH-277] 2014-05-04 20:37:09 -03:00
driver.rb driver: Remove calls to in favor of Vagrant's built in graceful halt 2014-07-24 21:58:04 -03:00
errors.rb Show something meaningful to the user in case the container already exists [GH-132] 2014-02-02 19:27:08 -02:00
plugin.rb Merge branch 'master' of github.com:jefmathiot/vagrant-lxc 2014-03-21 19:38:35 -03:00
provider.rb Work around WaitForCommunicator lock race condition 2014-09-29 16:47:29 -04:00
sudo_wrapper.rb driver/cli: Deal with namespaces args for lxc-attach when the sudo wrapper script is in place [GH-300] 2014-07-24 21:58:04 -03:00
synced_folder.rb synced_folder: Emit vagrant-mounted upstart event when starting containers 2014-09-22 23:44:01 -03:00
version.rb 🎆 v1.0.0 🎆 2014-09-23 01:03:48 -03:00