瀏覽代碼

AMBARI-16008. Restart Phoenix Query Server intermittently fails on SLES 11 SP3 (ncole)

Nate Cole 9 年之前
父節點
當前提交
6e46135ba1

+ 10 - 3
ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/phoenix_service.py

@@ -18,6 +18,8 @@ limitations under the License.
 
 """
 
+import errno
+from resource_management.core.logger import Logger
 from resource_management.core.resources.system import Execute
 from resource_management.core.resources.system import File
 from resource_management.libraries.functions import check_process_status, format
@@ -45,6 +47,11 @@ def phoenix_service(action = 'start'): # 'start', 'stop', 'status'
                 user=format("{hbase_user}"),
                 environment=env
         )
-        File(pid_file,
-             action = "delete"
-        )
+        try:
+          File(pid_file, action = "delete")
+        except OSError as exc:
+          # OSError: [Errno 2] No such file or directory
+          if exc.errno == errno.ENOENT:
+            Logger.info("Did not remove '{0}' as it did not exist".format(pid_file))
+          else:
+            raise