47 Commits

Author SHA1 Message Date
Mitchell Hashimoto
2385305f6f core: Don't encode! since string might be frozen 2014-12-10 09:27:00 -08:00
Mitchell Hashimoto
370ca050db Merge pull request #3707 from takekazuomi/fix/master/encodeissue
fix subprocess external encode issue.
2014-10-23 23:18:19 -07:00
Fabian Ruff
c72c8dce40 Selecting for duration of timeout can cause hang
When specifying a timeout, the subprocess used to select for timeout seconds on the stdout, stderr pipes.

This creates a race condition and can cause the `Subprocess#execute` to hang for the full timeout interval if the process has already exited and no more output is send to the pipes.

This race is happening with a higher probability if the subprocess is generating a lot of output.
2014-08-12 21:00:02 +02:00
Fabian Ruff
47de3225dd Subprocess: respect listeners on final yield 2014-07-31 11:32:25 +02:00
Kalman Hazins
bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Takekazu Omi
7da9648089 fix subprocess external encode issue. https://github.com/mitchellh/vagrant/issues/3706
in io.rb
 subprocess resuts convert external encoding to utf-8

in subprocess.rb
 command line argument convert utf-8 to  external encoding
2014-05-08 17:59:45 +09:00
Mitchell Hashimoto
ec35190cfc core: use process.alive? to avoid exceptions 2014-04-13 14:24:25 -07:00
Mitchell Hashimoto
8bfb4bda2b core: make sure any Subprocess exits no matter what 2014-02-12 21:35:54 -08:00
Mitchell Hashimoto
a6be44125d core: Seperate out IO util helper 2014-01-16 22:46:25 -08:00
Mitchell Hashimoto
138024d74c core: Unset DYLD_LIBRARY_PATH if setuid/setgid [GH-2243] 2013-09-20 17:43:11 -07:00
Mitchell Hashimoto
47120a86a2 core: modify DYLD_LIBRARY_PATH only if executing in installer [GH-2231] 2013-09-20 17:38:49 -07:00
Mitchell Hashimoto
5b2a28cd4c core: set the DYLD_LIBRARY_PATH before other env vars 2013-09-18 09:42:18 -07:00
Mitchell Hashimoto
7c3b342add core: restore the old DYLD_LIBRARY_PATH specifically 2013-09-18 09:41:57 -07:00
Mitchell Hashimoto
06bf3c6fdc core: Remove DYLD_LIBRARY_PATH if command not in installer [GH-2219] 2013-09-17 18:53:35 -07:00
Mitchell Hashimoto
7adffcb880 CHANGELOG 2013-07-16 16:34:53 -07:00
korya
a0774b5b5f Vagrant reports properly error for not found command 2013-07-15 08:52:53 +03:00
Mitchell Hashimoto
5f5203559f style nitpick 2013-07-12 16:05:56 +09:00
Mitchell Hashimoto
6c99f3dfa7 tweaks for style 2013-06-09 13:51:19 -07:00
Gabor Nagy
a4979c4824 [GH-654] Missing condition and translations 2013-06-03 00:04:25 +02:00
Gabor Nagy
4c00abe69e Modifies to use util/which [GH-654] 2013-06-02 03:48:47 +02:00
Gabor Nagy
0936267314 Fixes [GH-654] on Windows 8x64 and Ruby 1.9.3p374
Replaces the command with absolute path version if it exists.
2013-06-01 14:29:45 +02:00
Mitchell Hashimoto
d1eccbf98f SafeChdir all the things for thread safety 2013-04-03 08:31:43 -07:00
Mitchell Hashimoto
bd60d6b283 Lock around chdir in Subprocess for thread safety 2013-04-03 08:31:43 -07:00
Fabio Rehm
cc20d2f91e raise ChildProcess::LaunchError with the original message to ease debugging when running subprocesses 2013-03-09 15:31:28 -03:00
Mitchell Hashimoto
165dd63f78 New HandleBoxUrl built-in middleware to handlet the "box_url" config 2013-02-01 11:31:08 -08:00
Mitchell Hashimoto
4e6496bed7 Improve subprocess logging 2013-01-31 19:47:54 -08:00
Mitchell Hashimoto
c75ec09014 Lower IO.select timeouts to improve subprocess speeds
We were getting bit if the process exited while we were doing an
IO.select because it would then wait the full timeout.
2013-01-30 21:29:04 -08:00
Mitchell Hashimoto
5bc0fa1dff Default the IO.select result to empty array to avoid nil errors 2012-06-28 08:22:06 -07:00
Mitchell Hashimoto
0b9173efd9 Handle case that writers is nil on IO.select in subprocess
This can happen when IO.select timeout is reached when we're listening
for writers.
2012-06-27 13:54:05 -07:00
Mitchell Hashimoto
b393de052f Subprocess now only yields stdout/stderr if you're listening 2012-06-01 23:17:48 +02:00
Mitchell Hashimoto
1a6ae81aa9 Require what to be notified for with block and Subprocess.execute
There was an issue before where the stdin buffer would always have space
so it would always yield that block and Ruby would spin at 100%. Now we
require all callers to say what they want to listen for. This drops
CPU down to almost nothing.

See GH-832
2012-06-01 17:02:12 +02:00
Mitchell Hashimoto
a90f33dcf2 Avoid deadlock behavior on Windows subprocess IO [GH-765] 2012-02-28 09:44:28 -08:00
Mitchell Hashimoto
0ba3824106 Windows subprocess IO works again. [GH-721] 2012-02-10 00:53:22 -08:00
Mitchell Hashimoto
6c1eafe00e Update CHANGELOG 2012-02-05 13:23:53 +01:00
Joe Kutner
36f43fa676 moved the closing of subprocess streams to after the process has finished. 2012-02-05 13:21:50 +01:00
Mitchell Hashimoto
3f3476f323 Use symbol as a hash key for subprocess. Guarantees we always get a string back. 2012-01-19 17:24:22 -08:00
Mitchell Hashimoto
e85095d1bf Subprocess uses readpartial on IO for Windows [GH-610]
Windows doesn't support read_nonblock.
2012-01-05 23:48:30 -08:00
Mitchell Hashimoto
0d2cf4bbe7 Upgrade to ChildProcess 0.2.4 for LaunchError 2011-12-26 19:55:10 -08:00
Mitchell Hashimoto
cc9abc8b9b Fix up some subprocess comments 2011-12-22 21:55:57 -08:00
Mitchell Hashimoto
963bdff9fd Use Vagrant::Util::Subprocess for acceptance tests 2011-12-22 21:46:43 -08:00
Mitchell Hashimoto
9f498ccb06 Subprocess now works properly with Ruby 1.8.7 2011-12-22 16:22:41 -08:00
Mitchell Hashimoto
698ad0af7e Import progress works again 2011-12-22 11:29:58 -08:00
Mitchell Hashimoto
79460f6122 Subprocess: Check if data is empty after the process exits as well 2011-12-21 22:12:22 -08:00
Mitchell Hashimoto
271c3827a1 Subprocess: catch any stdout/stderr left over after process exits 2011-12-21 21:58:23 -08:00
Mitchell Hashimoto
63720cc750 Fix reload with VBoxManage 2011-12-21 16:48:19 -08:00
Mitchell Hashimoto
8eb1770b9d Fix issue where we may not get the full output in a subprocess 2011-12-21 14:28:43 -08:00
Mitchell Hashimoto
9debf5abe9 Attach a driver to each VM. Use that to detect VirtualBox. 2011-12-20 21:20:45 -08:00