Log the full blaze query command and the exit code if it fails unexpectedly.
We treat anything that's not 0 or 3 as an error, but don't actually log the problematic exit code. The command itself is also truncated from the previous info logs, which makes it a pain to debug.
@@ -131,9 +131,13 @@ public class BlazeQuerySourceToTargetProvider implements SourceToTargetProvider
.stderr(stderr)
.build()
.run();
- if (retVal != 0 && retVal != 3) {
// exit code of 3 represents a potentially expected, non-fatal error
// only display error output for non-3 exit code, when there's an unexpected error
+ if (retVal != 0 && retVal != 3) {
+ // the command would have been logged previously, but that would be truncated
+ // logging it again for easier repro from logs without blowing up the log size
+ context.output(PrintOutput.output("Failed to execute: " + command));
+ context.output(PrintOutput.output("Query command returned: " + retVal));
Splitter.on('\n')
.split(stderr.toString())
.forEach(line -> context.output(PrintOutput.output(line)));
