HADOOP-19011. Possible ConcurrentModificationException if Exec command fails (#6353)
This commit is contained in:
parent
16edb4ac96
commit
cf21f35526
@ -72,14 +72,14 @@ public int run(List<String> command, List<String> output,
|
|||||||
stdOut.start();
|
stdOut.start();
|
||||||
stdErr.start();
|
stdErr.start();
|
||||||
retCode = p.waitFor();
|
retCode = p.waitFor();
|
||||||
|
stdOut.join();
|
||||||
|
stdErr.join();
|
||||||
if (retCode != 0) {
|
if (retCode != 0) {
|
||||||
mojo.getLog().warn(command + " failed with error code " + retCode);
|
mojo.getLog().warn(command + " failed with error code " + retCode);
|
||||||
for (String s : stdErr.getOutput()) {
|
for (String s : stdErr.getOutput()) {
|
||||||
mojo.getLog().debug(s);
|
mojo.getLog().debug(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stdOut.join();
|
|
||||||
stdErr.join();
|
|
||||||
output.addAll(stdOut.getOutput());
|
output.addAll(stdOut.getOutput());
|
||||||
if (errors != null) {
|
if (errors != null) {
|
||||||
errors.addAll(stdErr.getOutput());
|
errors.addAll(stdErr.getOutput());
|
||||||
|
Loading…
Reference in New Issue
Block a user