Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 0.6.0
-
Component/s: None
-
Labels:None
-
Environment:
FreeBSD
Description
I've seen this problem on FreeBSD and I've been able to duplicate it on Mac OS X as well but I don't know about other platforms.
Long running commands (such as installing via ports in FreeBSD) do not show the output logged to standard out as it's created. Rather, they output all at once, only when the command has finished. This isn't much of a problem for short-running commands but it can be a big problem for commands that take a while to run (such as installing packages, especially from source).
Obviously, this is to do with buffering.
I have some fixes (for the run_command mixin) that address the issue on FreeBSD but I won't add the patches here until I manage to write some unit tests that show up the issue...
Enclosed patches also now will show the STDOUT and STDERR messages interleaved in the correct order, rather than just showing all the STDOUT messages followed by all the STDERR messages.
Patches here: http://github.com/mlandauer/chef/tree/chef-173
I would appreciate it if people could have a good hard look at the patches as the logging is pretty core to things and also there might be subtle error situations which are not handled properly. Also, there of course cross-platform differences which could cause problems.
The most troublesome change I had to make is here:
http://github.com/mlandauer/chef/blob/6ccd3662817ca2fe29ee17fb4bb0a21a908e1111/chef/lib/chef/mixin/command.rb#L159
setting args[:waitlast] to true (if it isn't overridden)