Reamer commented on a change in pull request #3825:
URL: https://github.com/apache/zeppelin/pull/3825#discussion_r446029378
##########
File path:
zeppelin-plugins/launcher/k8s-standard/src/main/java/org/apache/zeppelin/interpreter/launcher/K8sRemoteInterpreterProcess.java
##########
@@ -102,76 +121,71 @@ public String getInterpreterSettingName() {
@Override
public void start(String userName) throws IOException {
- /**
- * If a spark interpreter process is running, userName is set in
preparation for --proxy-user
- */
- if (isUserImpersonatedForSpark &&
!StringUtils.containsIgnoreCase(userName, "anonymous") && isSpark()) {
- this.userName = userName;
- } else {
- this.userName = null;
- }
+
+ Properties templateProperties = getTemplateBindings(userName);
// create new pod
- apply(specTempaltes, false);
- kubectl.wait(String.format("pod/%s", getPodName()), "condition=Ready",
getConnectTimeout()/1000);
+ apply(specTempaltes, false, templateProperties);
if (portForward) {
podPort =
RemoteInterpreterUtils.findRandomAvailablePortOnAllLocalInterfaces();
- portForwardWatchdog = kubectl.portForward(
- String.format("pod/%s", getPodName()),
- new String[] {
- String.format("%s:%s", podPort, K8S_INTERPRETER_SERVICE_PORT)
- });
+ localPortForward =
client.pods().inNamespace(namespace).withName(podName).portForward(K8S_INTERPRETER_SERVICE_PORT,
podPort);
}
long startTime = System.currentTimeMillis();
+ long timeoutTime = startTime + getConnectTimeout();
// wait until interpreter send started message through thrift rpc
synchronized (started) {
- if (!started.get()) {
+ while (!started.get()) {
+ long timetoTimeout = timeoutTime - System.currentTimeMillis();
+ if (timetoTimeout <= 0) {
+ stop();
+ throw new IOException("Launching zeppelin interpreter on kubernetes
is time out, kill it now");
Review comment:
@zjffdu How can the calling instance be informed that the creation of
the interpreting process has failed?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]