Skip to content

Keep the daemon's scheduled run going after an unchecked failure - #66

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/daemon-unchecked-exception
Nov 8, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/daemon-unchecked-exception

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • ScheduledBackupService.runScheduledBackup now catches Exception instead of only IOException around each user's backup. An unchecked failure for one user or organization (for example a GHException from github-api while paging through a repository listing) is logged as Error backing up <name>: <message> like any other failure. The remaining users are still backed up, and the run is still logged and reported as completed. This matches the per-user catch already used by the non-interactive CLI loop in BackupCommandLineRunner.
  • The now-unused java.io.IOException import is removed.
  • A ScheduledBackupServiceTest case is added, and a Fixed entry is added to CHANGELOG.md.

No other documentation needed changing. COMMANDS.md, CONFIG.md and USER_GUIDE.md already say a daemon failure is "logged as an error", which is now true for unchecked failures as well.

Test plan

  • testRunScheduledBackup_UncheckedExceptionDoesNotStopRemainingUsers was run against the unfixed code and failed with Unexpected exception thrown: java.lang.IllegalStateException: Listing interrupted. It passes with the fix.
  • mvn test: 223 tests run, 0 failures, 0 errors, 1 skipped (pre-existing skip), BUILD SUCCESS.
  • CI Build workflow green on the PR head.

Triage notes

Closes #65

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Only an IOException was caught per user, so a RuntimeException for one
user or organization skipped the rest of the run, its completion log and
its backup-completed event until the next interval. Catch Exception, as
the command-line loop already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (Copilot could not be added as a reviewer: Could not resolve user with login 'copilot'):

  • Scope: PASS. 3 files, +25/−2. The source change is the widened catch plus removal of the import it left unused, the test file gains one case, and CHANGELOG.md gains one entry.
  • Tests-new: PASS. No new public methods. The changed behavior is covered by testRunScheduledBackup_UncheckedExceptionDoesNotStopRemainingUsers.
  • Tests-fix: PASS. The test was run before the fix and failed with Unexpected exception thrown: java.lang.IllegalStateException: Listing interrupted. It passes with the fix (ScheduledBackupServiceTest: 20 run, 0 failures).
  • Sibling structure: PASS. The new test follows the existing testRunScheduledBackup_LogsErrorForFailedUser pattern: the ListAppender log capture and verify(..., times(1)).
  • Sibling renames: PASS. No identifiers were renamed.
  • Docs: PASS. COMMANDS.md and USER_GUIDE.md already say that in daemon mode a failure "is logged as an error", and CONFIG.md has nothing on this path. The fix makes that statement hold for unchecked failures, so only CHANGELOG.md needed a change.
  • Issue resolution: PASS. Daemon stops a scheduled run when one user fails with an unchecked exception #65 names ScheduledBackupService.runScheduledBackup's IOException-only catch, and that catch is the line changed.
  • CI: PASS. build (1m4s) and docker-build (45s) are green on the PR head.
  • Config-doc parity: PASS. No properties or @Value fields changed.
  • Command-doc parity: PASS. No CLI flags, system properties or endpoints changed.
  • Package placement: PASS. No new classes.
  • No credential leakage: PASS. The error log carries the user name and exception message only, which is the same as before.

Observation for the reviewer: src/main/java/com/github/backup/ScheduledBackupService.java:86 logs only e.getMessage(). For an unchecked exception that can be null (logged as Error backing up octocat: null), and no stack trace is kept. This matches the existing IOException handling and the CLI's Error backing up ... line, so it was left unchanged to keep this PR's scope tight. Passing e as a final SLF4J argument would keep the trace if more diagnostic detail is wanted later.

This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit d46a9b0 into main Nov 8, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/daemon-unchecked-exception branch November 8, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daemon stops a scheduled run when one user fails with an unchecked exception

1 participant