Repository navigation
Conversation
|
Thanks for picking this up. One bit of context that may be useful before this is merged: #72759 was opened after noticing that #71535 appears to recover the same interrupted-clone state through a narrower path, and I already offered an explicit regression test for that case on #71535. The two approaches seem to differ mainly in recovery scope:
The regression test added here is exactly the kind of coverage I was hoping to preserve for #72759, so I think the test itself is valuable either way. Would a maintainer mind taking a quick look at #71535 and this PR together and deciding which recovery behavior is preferable? If the broader cleanup/reclone semantics are intentional, this PR covers #72759 directly. If the narrower fetch-before-checkout behavior is preferred, the interrupted-clone regression test could instead be added to #71535 so this failure mode remains explicitly covered. |
|
Thanks for the context. I agree the narrower fetch-before-checkout path in #71535 may be preferable if we want to limit the recovery scope. I’ll leave the implementation unchanged for now and let the maintainers compare #71535 and #72787. The interrupted-clone regression test can be moved to #71535 if that approach is preferred. |
|
This fixes a second leftover state that we hit in production, which is worth recording here Airflow 3.3.0, providers-git 0.4.x, long-lived worker pods with pod-local bundle storage. A task All 30 tasks that landed on that pod over the next 23 minutes failed at Your change recovers this: the Happy to contribute a regression test for it if you want one in this PR: clone with Separately I have opened #72922 and a PR for the prevention half, staging the clone in a sibling |
|
@hkc-8010 |
A killed clone leaves a version directory that Git can open but that cannot resolve the tracking ref, and every later task pinned to that version failed forever because the broken directory was never repaired or replaced. Move the checkout inside _clone_repo_if_required's retry block so a repository that cannot resolve the tracking ref is discarded and re-cloned from the healthy local bare mirror instead of failing. This also lets a SHA-pinned tracking_ref be promoted in-place without clearing local storage.
d5a75ba to
e2ad4b8
Compare
|
Hello @Kunal8954 - thank you for your contributions to Apache Airflow! The Airflow community has introduced a limit of 5 open pull requests at a time for contributors without write access to the repository. You currently have 8 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:
These pull requests stay open because maintainers are already engaged in them - they count towards your limit:
This is not a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are. What we ask you to do is to make your first prioritization decision: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack. Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst. Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting |
When
GitDagBundleis killed while cloning a bundle version, it leaves behind aversion directory that git can open as a repository but that cannot resolve the
configured
tracking_ref.git clonewrites the.gitskeleton before itwrites refs or checks out the working tree, so such a leftover has
.gitwithno refs and an empty working tree. Every later task pinned to that bundle
version then failed on every retry:
because the broken directory was reopened but never repaired or replaced.
Change
Move
self.repo.git.checkout(self.tracking_ref)into_clone_repo_if_required, inside its@retry/shutil.rmtreeblock. Arepository that cannot resolve the tracking ref is now discarded and re-cloned
from the healthy local bare mirror instead of failing forever. This also lets a
SHA-pinned
tracking_refbe promoted in-place without clearing local storage(the case tracked in #71388).
Tests
test_interrupted_clone_version_dir_is_recovered: simulates a killedclone (
.gitskeleton present, refs/packed-refs absent, empty working tree),then asserts
initialize()restores both the expected version and the Dagfiles. Fails on
main, passes with this change.test_tracking_ref_commit_sha_promote_without_clearing_storage(was...promote_fails_without_clearing_storage) to assert in-place promotion nowsucceeds.
providers/git/tests/unit/git/— 141 passed.ruff,ruff format, andmypyon both changed files pass.closes: #72759
Was generative AI tooling used to co-author this PR?
src-notes: no newsfragment for a provider change (released from
main).