Log docker-machine output through Cmd writers instead of pipes

What does this MR do?

Makes docker-machine command output logging reliable. The runner no longer loses output a command writes just before exiting, and stops logging a spurious warning.

Why was this MR needed?

The output was read from pipes by goroutines that race process exit: the pipes close as soon as the process dies, so the tail of the output could be lost, and the tail is often the error explanation. The loser of the race also logged

WARNING: Problem while reading command output  error=read |0: file already closed

on every runner manager. An existing suppression only matched the older "bad file descriptor" flavor of the same race. The output now goes through writers the process copies into directly, which cannot race exit.

What's the best way to test this MR?

Unit tests, including a real command whose final unterminated line must survive.

What are the relevant issue numbers?

None, noticed while validating !7214 (merged) in a sandbox deployment.

Edited by Igor

Merge request reports

Loading
Loading