Commit bfb80f8b authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'formatting-msg-with-timeout'

7b2cb888 formatting: capture stderr for the error path with a timeout
Acked-by: Kitware Robot's avatarKitware Robot <>
Acked-by: Brad King's avatarBrad King <>
Merge-request: !136
parents 99bef2c9 7b2cb888
Pipeline #145134 passed with stage
in 0 seconds
......@@ -127,18 +127,24 @@ impl Formatting {
let (success, output) = if let Some(timeout) = self.timeout {
let mut child = cmd
// Formatters should not read anything.
// The output goes nowhere.
// But we want any error messages from them (for logging purposes). If this pipe
// fills up buffers, it will deadlock and the timeout will "save" us. Any process
// outputting this much error messages probably is very unhappy anyways.
.chain_err(|| "failed to construct formatter command")?;
let check = child.wait_timeout(timeout)
.chain_err(|| "failed to wait on the formatter command")?;
if let Some(status) = check {
(status.success(), format!("failed with exit code {:?}, signal {:?}",
(status.success(), format!("failed with exit code {:?}, signal {:?}, output: {:?}",
child.stderr.expect("spawned with stderr")))
} else {
child.kill().chain_err(|| "failed to kill a timed-out formatter")?;
let timed_out_status = child.wait_timeout(*ZOMBIE_TIMEOUT)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment