You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rk...@apache.org on 2017/01/23 06:15:52 UTC

[2/2] ambari git commit: AMBARI-19648 Intermittent Zeppelin Server start failure during service install and start from Ambari (r-kamath)

AMBARI-19648 Intermittent Zeppelin Server start failure during service install and start from Ambari (r-kamath)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2463b0a2
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2463b0a2
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2463b0a2

Branch: refs/heads/trunk
Commit: 2463b0a2632668c778293ffe352e928ff5ccf7b3
Parents: 593234b
Author: Renjith Kamath <re...@gmail.com>
Authored: Mon Jan 23 11:44:20 2017 +0530
Committer: Renjith Kamath <re...@gmail.com>
Committed: Mon Jan 23 11:45:21 2017 +0530

----------------------------------------------------------------------
 .../ZEPPELIN/0.6.0.2.5/package/scripts/master.py    | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2463b0a2/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index ac56aa2..b609538 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -20,6 +20,7 @@ limitations under the License.
 
 import glob
 import os
+from resource_management.core.base import Fail
 from resource_management.core.resources import Directory
 from resource_management.core.resources.system import Execute, File
 from resource_management.core.source import InlineTemplate
@@ -32,6 +33,7 @@ from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions import conf_select
 from resource_management.libraries.functions import stack_select
 from resource_management.libraries.functions import StackFeature
+from resource_management.libraries.functions.decorator import retry
 from resource_management.libraries.functions.stack_features import check_stack_feature
 from resource_management.libraries.functions.version import format_stack_version
 from resource_management.libraries.script.script import Script
@@ -168,7 +170,6 @@ class Master(Script):
   def start(self, env, upgrade_type=None):
     import params
     import status_params
-    import time
     self.configure(env)
 
     Execute(("chown", "-R", format("{zeppelin_user}") + ":" + format("{zeppelin_group}"), "/etc/zeppelin"),
@@ -345,21 +346,14 @@ class Master(Script):
 
     self.set_interpreter_settings(config_data)
 
-  def check_zeppelin_server(self, retries=10):
+  @retry(times=30, sleep_time=5, err_class=Fail)
+  def check_zeppelin_server(self):
     import params
-    import time
     path = params.conf_dir + "/interpreter.json"
     if os.path.exists(path) and os.path.getsize(path):
       Logger.info("interpreter.json found. Zeppelin server started.")
-      return True
     else:
-      if retries > 0:
-        Logger.info("interpreter.json not found. waiting for zeppelin server to start...")
-        time.sleep(5)
-        self.check_zeppelin_server(retries - 1)
-      else:
-        return False
-    return False
+      raise Fail("interpreter.json not found. waiting for Zeppelin server to start...")
 
   def get_zeppelin_spark_dependencies(self):
     import params