hyunw9 opened a new pull request, #5316: URL: https://github.com/apache/zeppelin/pull/5316
### What is this PR for? The Docker launcher's isAlive() isn't really implemented. It just calls isRunning(), which only checks whether the interpreter's Thrift port accepts a connection (checkIfRemoteEndpointAccessible). That tells you the port is open, not that the process behind it is alive. A container can be OOMKilled or already gone and still look alive if the port happens to answer for a moment. It also doesn't match the InterpreterClient contract, which says isAlive should reflect process status and stay separate from running. The method still had //TODO(ZEPPELIN-5876): Implement it more accurately sitting on it. While I was there I filled in getErrorMessage(), which always returned null. When the container isn't running it now says why: OOMKilled, or a non-zero exit code. That logic lives in a small describeContainerFailure() helper to keep getErrorMessage() short. One change is test-only: the docker field is now 'VisibleForTesting', so tests can inject a mock DockerClient and skip needing a real daemon. ### What type of PR is it? Feature ### Todos - [x] Implement isAlive() from the container's actual state (running/paused) - [x] Implement getErrorMessage() (OOMKilled / exit code) - [x] Unit tests with a mocked DockerClient ### What is the Jira issue? [[ZEPPELIN-5876]](https://issues.apache.org/jira/browse/ZEPPELIN-5876) ### How should this be tested? Automated unit tests in DockerInterpreterProcessTest : - isAlive_trueWhenContainerRunning - running == true → alive - isAlive_falseWhenContainerExitedOrOomKilled — running == false → not alive - getErrorMessage_reportsOomKilled - oomKilled == true → message contains the reason ### 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]
