Skip to content

[Bug]: fs.rm EBUSY swallow in backup-create.ts defeats retry backoff loop on Windows #101382

Description

@aniruddhaadak80

Description

In src/infra/backup-create.ts, the writeTarArchiveWithRetry function attempts to clean up the temporary archive on failure using fs.rm at line 191:

await fs.rm(params.tempArchivePath, { force: true });

If the runTar process leaked an open file descriptor (which is common on Windows during failure), fs.rm will throw an EBUSY error. The error is caught, logged as a warning, and the retry loop continues without the file being removed.

When the next runTar attempt starts, it will try to write to params.tempArchivePath and immediately fail again because the file is still locked. This completely defeats the BACKUP_TAR_BACKOFF_MS mechanism, causing an immediate cascade of failures until BACKUP_TAR_MAX_ATTEMPTS is reached.

Location

src/infra/backup-create.ts

Impact

Backup creation can instantly fail on Windows instead of surviving temporary filesystem locks or IO contention via backoff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.no-staleExclude from stale automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions