-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
JSON file reads should retry on transient race conditions #83657
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug Description
JsonFileReadError: File changed during readoccurs whenpaired.jsonis rewritten while another component is reading it. This is a transient race condition that should be handled gracefully rather than causing gateway failures.Steps to Reproduce
paired.jsonrewrite (e.g., openopenclaw logs --follow)paired.jsonduring the temp-file + rename operationJsonFileReadError: Failed to read JSON file: /home/simon/.openclaw/devices/paired.jsongateway closed (1000)Expected Behavior
JSON file reads should be resilient to concurrent rewrites:
File changed during read(max 3 attempts, 50ms backoff)Actual Behavior
paired.jsonrewrite → amplification loopEnvironment
Related Issues
paired.jsonstale entries and rewrite frequencyopenclaw logs --followregisters as paired devicepaired.jsonleads to overwrite of all pairings #71873 — Silent read error onpaired.jsonRecommendation
Implement bounded retry logic for JSON file reads:
This is a standard pattern for atomic file operations and should be applied to all JSON config reads, not just
paired.json.