Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

52: The HgToGitConverter waits for child processes indefinitely #165

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -32,6 +32,7 @@
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.logging.Logger;
import java.util.stream.Collectors;
@@ -79,6 +80,15 @@ Path stderr() {
return stderr;
}

int waitForProcess() throws InterruptedException {
var finished = process.waitFor(12, TimeUnit.HOURS);
if (!finished) {
process.destroyForcibly().waitFor();
throw new RuntimeException("Command '" + String.join(" ", command) + "' did not finish in 12 hours");
}
return process.exitValue();
}

@Override
public void close() throws IOException {
if (stdout != null) {
@@ -605,7 +615,7 @@ private ProcessInfo fastImport(ReadOnlyRepository repo) throws IOException {

private void await(ProcessInfo p) throws IOException {
try {
int res = p.process().waitFor();
int res = p.waitForProcess();
if (res != 0) {
var msg = String.join(" ", p.command()) + " exited with status " + res;
log.severe(msg);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.