jscheffl commented on code in PR #62307:
URL: https://github.com/apache/airflow/pull/62307#discussion_r2843197789
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/eks.py:
##########
@@ -591,6 +592,21 @@ def _secure_credential_context(
except OSError:
pass # Best effort cleanup
+ @staticmethod
+ def _ensure_aws_cli_cache_dir() -> None:
+ """
+ Pre-create ``~/.aws/cli/cache`` to prevent a race condition in
botocore < 1.40.2.
+
+ When multiple tasks concurrently invoke ``aws eks get-token`` on the
same
+ worker, older botocore versions call ``os.makedirs()`` without
+ ``exist_ok=True``, causing intermittent ``FileExistsError`` that
surfaces
+ as a misleading 403 Forbidden from the Kubernetes API.
+
+ Calling ``os.makedirs(..., exist_ok=True)`` here is the same one-line
fix
+ applied upstream in botocore 1.40.2, just done earlier in the call
chain.
Review Comment:
If I take a look to current pyroject.toml in Amazon provider I see the
dependency is defined as `"botocore>=1.41.0"` - are you sure then we need this
fix at-all?
--
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]