Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java')
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java
index 4e0cf600fc..8c96982510 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/ContainerCommandProcess.java
@@ -126,15 +126,13 @@ public class ContainerCommandProcess extends Process {
}
@Override
- public synchronized void destroy() {
+ public void destroy() {
try {
+ // kill the container
try {
- // TODO: see if there is a better way of draining the
- // container output before closing the streams. Note
- // that trying to join the attachLog thread does not
- // work.
+ connection.killContainer(containerId);
Thread.sleep(1000);
- } catch (InterruptedException e1) {
+ } catch (DockerException | InterruptedException e) {
// ignore
}
// give logging thread at most 5 seconds to terminate
@@ -154,7 +152,7 @@ public class ContainerCommandProcess extends Process {
}
@Override
- public synchronized int exitValue() {
+ public int exitValue() {
// if container has been removed, we need to return
// the exit value that we cached before removal
if (containerRemoved) {
@@ -173,6 +171,9 @@ public class ContainerCommandProcess extends Process {
return state.exitCode();
}
}
+ if (containerRemoved) {
+ return exitValue;
+ }
return -1;
}

Back to the top