Skip to content

fix(backup): a malformed request fails its own result instead of crashing the service - #61

Merged
AmrMsCLL merged 1 commit into
mainfrom
fix/backup-bad-request
Nov 7, 2026
Merged

AmrMsCLL merged 1 commit into
mainfrom
fix/backup-bad-request

Conversation

@AmrMsCLL

@AmrMsCLL AmrMsCLL commented Nov 7, 2026

Copy link
Copy Markdown
Member

What

  • handle() parses the request inside its try, so a request file that is not JSON (or names no action) writes a failed .result and is removed, instead of raising out of the serve loop.
  • The restart sweep tolerates a .running file it cannot parse, so the service no longer crash-loops on the same file after a restart.

Why

Found during the Graphite Hub phase 7 verification: a hand-written request with broken quoting crashed backup-backup-1, and because the file had already been renamed to .running, every restart crashed again at the sweep until the file was deleted by hand.

Verified

Ran handle() from the patched script against a scratch root with a malformed request, an unknown action and a stale malformed .running file: all three produce ok: false results with the reason, the files are cleaned up, and the loop continues.

…hing the service

A request file that is not JSON used to raise out of handle() and end the serve loop; the file was left as .running, so every restart crashed again on the same file until it was removed by hand. The order is now parsed inside the try, so a bad request writes a failed .result and is removed, and the restart sweep tolerates a .running file it cannot parse.
@AmrMsCLL
AmrMsCLL requested a review from a team as a code owner November 7, 2026 00:50
@github-actions github-actions Bot added the size/s 11-50 changed lines, excluding lockfiles label Nov 7, 2026
@AmrMsCLL
AmrMsCLL merged commit 663186a into main Nov 7, 2026
5 checks passed
@AmrMsCLL
AmrMsCLL deleted the fix/backup-bad-request branch November 7, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s 11-50 changed lines, excluding lockfiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant