Skip to content

[ZEPPELIN-5876] Implement DockerInterpreterProcess.isAlive() using container state#5316

Open
hyunw9 wants to merge 1 commit into
apache:masterfrom
hyunw9:ZEPPELIN-5876
Open

[ZEPPELIN-5876] Implement DockerInterpreterProcess.isAlive() using container state#5316
hyunw9 wants to merge 1 commit into
apache:masterfrom
hyunw9:ZEPPELIN-5876

Conversation

@hyunw9

@hyunw9 hyunw9 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

  • Implement isAlive() from the container's actual state (running/paused)
  • Implement getErrorMessage() (OOMKilled / exit code)
  • Unit tests with a mocked DockerClient

What is the Jira issue?

[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant