This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DATALAB-3098
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit b79d4b748ec71cce50b63643c911b9f9ff24af1b
Author: leonidfrolov <[email protected]>
AuthorDate: Fri Nov 4 17:01:29 2022 +0200

    [DATALAB-3098]: added check in case of hdinsight cluster creation failure
---
 infrastructure-provisioning/src/general/lib/azure/actions_lib.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/infrastructure-provisioning/src/general/lib/azure/actions_lib.py 
b/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
index 1bebb2f21..d5fc54792 100644
--- a/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
+++ b/infrastructure-provisioning/src/general/lib/azure/actions_lib.py
@@ -1249,6 +1249,8 @@ class AzureActions:
                 time.sleep(30)
                 logging.info('The cluster is being provisioned... Please wait')
                 cluster = 
datalab.meta_lib.AzureMeta().get_hdinsight_cluster(resource_group_name, 
cluster_name)
+                if cluster.properties.cluster_state in 
'Error|Unknown|TimedOut':
+                    raise Exception
             return result
         except Exception as err:
             logging.info(
@@ -1257,6 +1259,7 @@ class AzureActions:
             append_result(str({"error": "Unable to create HDInsight Spark 
cluster",
                                "error_message": str(err) + "\n Traceback: " + 
traceback.print_exc(
                                    file=sys.stdout)}))
+            AzureActions().terminate_hdinsight_cluster(resource_group_name, 
cluster_name)
             traceback.print_exc(file=sys.stdout)
 
     def terminate_hdinsight_cluster(self, resource_group_name, cluster_name):


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to