Fezzik::Util.capture_output overrides $stdout without synchronizing it between threads. This creates a race condition when multiple threads attempt to print.
include Fezzik::DSL
destination :prod do
set :domain, ["a.com", "b.com"]
end
remote_task :echo do
output = capture_output { run "echo 'hi'" }
puts output.inspect
end
$ fez prod echo
Loading Fezzik tasks from config/tasks
Targeting hosts:
a.com
b.com
""
"hi\nhi\n"
[success]
Fezzik::Util.capture_output
overrides$stdout
without synchronizing it between threads. This creates a race condition when multiple threads attempt to print.