fix(backup): retry fs.rm on EBUSY to prevent retry-loop collapse on Windows#101395
Closed
tzy-17 wants to merge 1 commit into
Closed
fix(backup): retry fs.rm on EBUSY to prevent retry-loop collapse on Windows#101395tzy-17 wants to merge 1 commit into
tzy-17 wants to merge 1 commit into
Conversation
…indows fs.rm can throw EBUSY on Windows when the tar process leaked a file descriptor. The existing catch logged a warning and continued, but the temp file remained locked, causing the next runTar attempt to fail immediately — defeating the BACKUP_TAR_BACKOFF_MS retry. Add a short retry loop (3 attempts with 100ms/200ms backoff) for EBUSY before falling through to the existing warning path. Fixes openclaw#101382
Member
|
Closing as the weaker duplicate of #101397 for #101382. Both branches add short This closure consolidates the issue; it is not a merge endorsement of #101397. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes #101382: On Windows,
fs.rmcan throwEBUSYwhen the tar process leaked a file descriptor. The catch block logged a warning and continued, but the temp file remained locked — causing the nextrunTarattempt to fail immediately because it couldn't overwrite the locked file. This completely defeated theBACKUP_TAR_BACKOFF_MSretry mechanism.Why This Change Was Made
Added a short retry loop (3 attempts, 100ms/200ms backoff) for
EBUSYbefore falling through to the existing warning path. This gives the OS time to release the file lock, allowing the retry loop to function correctly.User Impact
Evidence
pnpm test src/infra/backup-create.test.ts— 39 tests passoxlintpasses🤖 Generated with Claude Code