From 42fa0a65403a14ecae8b2a50908944cd4d400b9a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 12 Feb 2014 21:31:05 -0800 Subject: [PATCH] core: poll for process exit on SSH#exec with subprocess --- lib/vagrant/util/ssh.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb index 487b972b0..9809b0d91 100644 --- a/lib/vagrant/util/ssh.rb +++ b/lib/vagrant/util/ssh.rb @@ -174,7 +174,13 @@ module Vagrant process = ChildProcess.build("ssh", *command_options) process.io.inherit! process.start - process.wait + + # Poll for exited rather than call #wait because #wait will hold + # the GIL, locking up the entire Ruby VM. See ChildProcess #68 + while !process.exited? + sleep 0.2 + end + return process.exit_code end end