MichalJaroslawKrzywanski-TomTom commented on code in PR #73878:
URL: https://github.com/apache/airflow/pull/73878#discussion_r4141466943
##########
providers/git/src/airflow/providers/git/bundles/git.py:
##########
@@ -289,7 +289,11 @@ def _clone_repo_if_required(self) -> None:
@retry(
retry=retry_if_exception_type((InvalidGitRepositoryError,
GitCommandError)),
- stop=stop_after_attempt(2),
+ # GitHub rejects a just-issued App installation token with "Repository
not found" for a
+ # few seconds. Back off between attempts so one lands after the token
has propagated,
+ # instead of failing the task on an immediate second attempt.
+ stop=stop_after_attempt(5),
+ wait=wait_exponential(multiplier=2, max=15),
Review Comment:
It's 2, 4, 8, 15s between five attempts, so ~29s worst case.
▎
▎ You're right that it's pointless for SSH/PAT. The window only exists for
a freshly minted GitHub App token, and the hook knows when it minted one, so I
keyed the retry off that instead of a config option:
▎ GitHook.uses_github_app_auth (same check configure_hook_env already
does), and the bundle passes tenacity a stop/wait callable. GitHub App
connections get the 5 attempts with backoff, everything else stays
▎ at the current 2 immediate attempts.
▎
▎ @jedcunningham a fixed sleep after minting would have to be ~10s to be
safe (in #73877 one fetch still failed 4.5s after the token was issued and
worked at 10s), and every task pod would pay it while ~19
▎ of 20 don't need to wait at all. The backoff only costs time when we
actually hit the window, so I kept it as a retry wait, just scoped to the App
path.
--
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]