Quellcode durchsuchen

Allow storage-account creation enough time to resolve DNS

access_key_result was decorated with tenacity.retry(
stop_after_attempt(5)) and no wait, so the 5 attempts ran in ~100ms.
Azure storage accounts transition Creating -> ResolvingDns ->
Succeeded; ResolvingDns alone is typically 30-60s for a freshly named
blob endpoint, so any cold-start call hit WaitStateException reliably.

Wait up to ~1.5 minutes (9 attempts x 10s) and only retry on the
not-yet-ready signal so genuine errors (auth, missing account) still
fail fast.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Nuwan Goonasekera vor 16 Stunden
Ursprung
Commit
c770c34ca8
1 geänderte Dateien mit 12 neuen und 1 gelöschten Zeilen
  1. 12 1
      cloudbridge/providers/azure/azure_client.py

+ 12 - 1
cloudbridge/providers/azure/azure_client.py

@@ -188,8 +188,19 @@ class AzureClient(object):
 
         log.debug("azure subscription : %s", self.subscription_id)
 
+    # Storage account creation transitions through Creating -> ResolvingDns
+    # -> Succeeded. ResolvingDns alone is typically 30-60s for the public
+    # blob endpoint; the original retry config (5 attempts, no wait) gave
+    # up in ~100ms and surfaced as WaitStateException on any cold start.
+    # Allow ~1.5 minutes total with a fixed backoff, and only retry on the
+    # not-yet-ready signal so genuine errors fail fast.
     @property
-    @tenacity.retry(stop=tenacity.stop.stop_after_attempt(5), reraise=True)
+    @tenacity.retry(
+        stop=tenacity.stop.stop_after_attempt(9),
+        wait=tenacity.wait_fixed(10),
+        retry=tenacity.retry_if_exception_type(WaitStateException),
+        reraise=True,
+    )
     def access_key_result(self):
         if not self._access_key_result:
             storage_account = self.storage_account