hyunw9 opened a new pull request, #5302:
URL: https://github.com/apache/zeppelin/pull/5302

   ### What is this PR for?
   
   The Docker interpreter launcher (DockerInterpreterProcess) can leak 
resources on error paths when interpreters are started/stopped repeatedly by 
notebook workloads.
   
   1. stop() may leak the DockerClient. docker.close() was called after the 
try/catch that kills/removes the container. If killContainer/removeContainer 
throws an unexpected (unchecked) exception, it is not caught and docker.close() 
is skipped, leaking the underlying HTTP socket / file descriptors.
   2. start() may leave an orphaned container. start() runs pull → create → 
start → copy files → exec → wait-for-register. If preparation fails after the 
container is started (e.g. copyRunFileToContainer / execInContainer), the 
running container is not cleaned up 
   
   ### What type of PR is it?
   Bug Fix
   
   ### Todos
   - [x] Fix stop() to always close the DockerClient
   - [x] Fix start() to clean up a started container on preparation failure
   - [x] Add unit tests (Mockito interaction tests)
   
   ### What is the Jira issue?
   * [[ZEPPELIN-6539]](https://issues.apache.org/jira/browse/ZEPPELIN-6539)
   
   ### How should this be tested?
   
   Automated unit tests added in DockerInterpreterProcessTest (DockerClient is 
mocked):
   - stop_alwaysClosesDockerClient_evenWhenKillContainerFails
   - start_removesContainer_whenContainerPreparationFails 
   
   ### Screenshots (if appropriate)
   
   
   
   ### Questions:
   * Does the license files need to update? - No
   * Is there breaking changes for older versions? - No
   * Does this needs documentation? - No
   


-- 
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