kaxil commented on a change in pull request #16404:
URL: https://github.com/apache/airflow/pull/16404#discussion_r670028958



##########
File path: airflow/models/variable.py
##########
@@ -201,7 +201,13 @@ def get_variable_from_secrets(key: str) -> Optional[str]:
         :return: Variable Value
         """
         for secrets_backend in ensure_secrets_loaded():
-            var_val = secrets_backend.get_variable(key=key)
-            if var_val is not None:
-                return var_val
+            try:
+                var_val = secrets_backend.get_variable(key=key)
+                if var_val is not None:
+                    return var_val
+            except Exception:  # pylint: disable=broad-except
+                log.exception(
+                    'Unable to retrieve variable from alternative secrets 
backend. '

Review comment:
       This will raise the same error if there is any error getting variable 
from default secret backends (env var and db).
   
   Let's separate this PR into 2:
   
   1) GCP Change in airflow/providers/google/cloud/secrets/secret_manager.py
   2) Broader Secrets Failover Change (with optional retries controlled via 
airflow.cfg 🤷 )




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to