Skip to content

fix: stale file race condition causes retry loops (782 retries), HTTP 404 misclassified as validation #610

Description

@anandgupta42

Problem

Telemetry analysis (Mar 30-Apr 1) shows 4,500 validation errors over 2 days, broken into 3 root causes:

1. Stale File Race Condition (54% — 2,453 errors)

FileTime.read() records new Date() as the last-read timestamp, but filesystem mtime can differ due to clock drift (especially on WSL/NTFS-over-9P). The 50ms tolerance is far too small — p50 gap is 651ms. This causes massive retry loops: one session hit 782 retries on a single file.

2. HTTP 404 Misclassified as "validation" (13% — 602 errors)

The keyword "does not exist" in the validation error pattern matches WebFetch 404 error messages like "HTTP 404: url does not exist", inflating validation error counts.

3. File staleness errors mixed into "validation" bucket (32% — 1,445 errors)

"must read file" and "has been modified since" errors are conceptually different from input validation errors but share the same validation class, making triage harder.

Evidence (from AppInsights KQL)

  • 12 sessions entered retry loops, worst case: 782 retries on one file
  • p50 mtime-vs-readtime gap: 651ms (50ms tolerance was ~13x too small)
  • Affected users primarily on WSL (/mnt/c/... paths) and macOS
  • Versions affected: 0.5.15 and 0.5.16

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions