Skip to content

[bugfix/MoreStability] Added more stability when a container errors #29

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

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public Optional<List<String>> snippets(boolean includeStartupScript) throws Dock
}
return Optional.of(includeStartupScript ? snippets
: snippets.subList(startupScriptSize, snippets.size()));
} catch (IOException ex) {
} catch (Exception ex) {
LOGGER.warn("Unexpected error.", ex);
close();
throw new DockerException(ex);
Expand Down Expand Up @@ -234,30 +234,15 @@ private void updateLastTimeout() {
private void checkContainerOK() throws DockerException {
try {
if (dockerService.isDead(containerName())) {
try {
close();
} finally {
throw new DockerException("Container of session " + id + " is dead");
}
throw new IOException("Container of session " + id + " is dead");
}
String OK = reader.readLine();
if (OK == null) {
try {
close();
} finally {
throw new DockerException("Container of session " + id + " is dead");
}
}
if (!OK.equals("OK")) {
try {
close();
} finally {
throw new DockerException(
"Container of session " + id + " returned invalid info : " + OK);
}
String ok = reader.readLine();
if (ok == null || !ok.equals("OK")) {
throw new IOException(
"Container of session " + id + " is dead because status was " + ok);
}
} catch (IOException ex) {
LOGGER.warn("Unexpected error.", ex);
close();
throw new DockerException(ex);
}
}
Expand Down
Loading