Skip to content

Fix renameFileWithRetry leaving temporary files after copying - #12246

Merged
mergify[bot] merged 1 commit into
masterfrom
fix-renameFileWithRetry
Aug 22, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
fix-renameFileWithRetry

Conversation

@Bodigrim

Copy link
Copy Markdown
Collaborator

@ffaf1 @TravisCardwell could you please check whether this fixes #12244?

Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@TravisCardwell

Copy link
Copy Markdown
Contributor

I tried it, and no .tmp files are left in /tmp. 🎉

Taking a look at the change, I noticed that retriesLeft is no longer decremented. Investigating the full function, it indeed does not need to be decremented on the changed line, but it should be decremented in the exception handler for the copyFile call here. As is, retryCopy may loop indefinitely.

@Bodigrim
Bodigrim force-pushed the fix-renameFileWithRetry branch from 86ae5ad to 5078e7d Compare August 19, 2026 00:13
@Bodigrim

Copy link
Copy Markdown
Collaborator Author

@TravisCardwell good catch, should be fixed now.

@ulysses4ever

Copy link
Copy Markdown
Collaborator

it might be good to check again that this does indeed solve the issue

@TravisCardwell

Copy link
Copy Markdown
Contributor

I tried it again, and no .tmp files are left in /tmp. 🎉

@ffaf1 ffaf1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
I confirm it fixes the issue on my machine.

@Bodigrim Bodigrim added the merge me Tell Mergify Bot to merge label Aug 19, 2026
@mergify mergify Bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days queued labels Aug 20, 2026
@mergify

mergify Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 59 minutes 45 seconds in the queue, including 1 hour 48 minutes 30 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

@mergify
mergify Bot merged commit 1baac1d into master Aug 22, 2026
146 of 155 checks passed
@mergify
mergify Bot deleted the fix-renameFileWithRetry branch August 22, 2026 04:45
@mergify mergify Bot removed the queued label Aug 22, 2026
@zlonast

zlonast commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

@mergify backport 3.18

@mergify

mergify Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

backport 3.18

✅ Backports have been created

Details

mergify Bot added a commit that referenced this pull request Sep 1, 2026
Backport #12246: Fix renameFileWithRetry leaving temporary files after copying
@ulysses4ever

Copy link
Copy Markdown
Collaborator

no changelog entry :-(

@ffaf1

ffaf1 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

no changelog entry :-(

No worries, I spotted/added it manually in #12346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attention: needs-backport 3.18 merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cabal-install 3.18.1.0 leaves many .tmp files in /tmp

5 participants