tbonelee commented on code in PR #5302:
URL: https://github.com/apache/zeppelin/pull/5302#discussion_r3583988726


##########
zeppelin-plugins/launcher/docker/src/main/java/org/apache/zeppelin/interpreter/launcher/DockerInterpreterProcess.java:
##########
@@ -363,10 +385,22 @@ public void stop() {
       Thread.currentThread().interrupt();
     } catch (DockerException e) {
       LOGGER.error(e.getMessage(), e);
+    } finally {
+      docker.close();
     }
+  }
 
-    // Close the docker client
-    docker.close();
+  // Best-effort removal of a container that was (partially) created during 
start().
+  private void cleanupContainerQuietly() {
+    try {
+      docker.killContainer(containerName);

Review Comment:
   **Suggestion (non-blocking):** In `cleanupContainerQuietly()`, 
`killContainer` and `removeContainer` share one `try`, so if `killContainer` 
throws (e.g. the container was created but never started, so it isn't running), 
`removeContainer` is skipped and the container is still leaked. Could we run 
them independently so `removeContainer` always fires?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to