Skip to content

Fix rsync exit code 23 hint and container start retry logic#686

Merged
Minituff merged 1 commit into
mainfrom
container-start-handling
May 24, 2026
Merged

Fix rsync exit code 23 hint and container start retry logic#686
Minituff merged 1 commit into
mainfrom
container-start-handling

Conversation

@Minituff

Copy link
Copy Markdown
Owner

Fixes two bugs reported by users after the 2.15.0 / 2.17.0 releases.

Changes

rsync exit code 23 — symlink hint (backup.py)

Exit code 23 (partial transfer) fires when the destination filesystem doesn't support symlinks. All regular files are still backed up. The error message now explains the cause and points at the fix:

rsync exited with code 23 for <container> (symlinks may have been skipped — use RSYNC_CUSTOM_ARGS=--no-links to suppress)

Container start retry logic (backup.py)

Two bugs in _start_container:

  1. Missing return before the recursive retry call — a successful retry always returned False to the caller, incorrectly recording the container as failed even when it started fine.
  2. The "was not stopped" guard (if status != "exited") was also triggered during retries when the container was in a legitimate transitional state (e.g. restarting). The fix splits the check: running → never stopped; any other non-exited state → wait 2 s and retry (up to 3×).

A comment listing the valid Docker container statuses (created / restarting / running / paused / exited / dead) is included to make clear there is no "starting" state.

Tests

Three new tests added to pytest/test_backup.py:

  • test_start_container_transitional_state_eventually_running — container in restarting state after c.start() is retried and eventually reaches running; backup marked completed.
  • test_start_container_retry_success_propagates — container start succeeds on attempt 2; backup marked completed (not failed), verifying the missing-return fix.
  • test_rsync_exit_code_23_includes_symlink_hint — exit code 23 error message contains the symlink hint and --no-links reference.

@codecov

codecov Bot commented May 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.96%. Comparing base (7c71803) to head (1ba3dd9).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
app/backup.py 85.71% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #686      +/-   ##
==========================================
- Coverage   92.30%   91.96%   -0.35%     
==========================================
  Files           9        9              
  Lines        1091     1107      +16     
==========================================
+ Hits         1007     1018      +11     
- Misses         84       89       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Minituff Minituff merged commit 8b25fda into main May 24, 2026
3 of 5 checks passed
@Minituff Minituff deleted the container-start-handling branch May 24, 2026 17:16
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.

1 participant