Bound the FTP connections allod site deploy opens #186

Closed
opened 2026-09-10 19:08:24 +01:00 by allod-agent · 0 comments
Member

Cap the simultaneous FTP connections allod site deploy opens so a sync to shared hosting finishes instead of tripping the host's per-client connection limit partway through (the failure in allod/tools#184).

Primary goals:

  • Bounded connections — the rclone sync that deploy runs passes --transfers, --checkers, and --ftp-concurrency, with the concurrency one more than the sum of the other two, as rclone's FTP documentation requires for a sync to avoid deadlock.
  • Small, fixed defaults — two transfers, two checkers, five connections. Shared hosts commonly allow a handful of connections per client; the value that matters is that the total is bounded, not that it is tuned.
  • Pinned, not documented — a test asserts the exact flags in the sync argv, so a later change that drops one fails a test rather than a deploy.
  • Dry run identical--dry-run passes the same flags, so its listing exercises the same connection budget.

Current state and specifics

siteDeploy in cmd/allod/site.go builds syncArgs as sync <store path> <docroot>, the profile's --filter-from, --backup-dir, and --verbose, then --dry-run when asked. rclone's defaults fill the rest: four transfers, eight checkers, and the FTP backend's concurrency of 0, unlimited. Directory listing during the check phase is what opens connections in parallel; with the store-path timestamps honoured by the host, the transfer set of a typical deploy is small and the listings still exceed the limit (allod/tools#184).

The flags belong in the deploy's own argv, next to --backup-dir, rather than in the rclone config stanza: the stanza is the credential, placed by agenix and rotated by rotate-token, and its parser accepts exactly the five keys allod site config writes.

Scope

In: the three flags in siteDeploy's sync argv, the test that pins them, and one sentence in the deploy detail prose saying the sync is connection-bounded.

Out: making the numbers a hosting-profile field (trigger: a host whose limit the fixed values do not fit), and check, which opens one connection.

Cap the simultaneous FTP connections `allod site deploy` opens so a sync to shared hosting finishes instead of tripping the host's per-client connection limit partway through (the failure in allod/tools#184). Primary goals: - **Bounded connections** — the `rclone sync` that deploy runs passes `--transfers`, `--checkers`, and `--ftp-concurrency`, with the concurrency one more than the sum of the other two, as rclone's FTP documentation requires for a sync to avoid deadlock. - **Small, fixed defaults** — two transfers, two checkers, five connections. Shared hosts commonly allow a handful of connections per client; the value that matters is that the total is bounded, not that it is tuned. - **Pinned, not documented** — a test asserts the exact flags in the sync argv, so a later change that drops one fails a test rather than a deploy. - **Dry run identical** — `--dry-run` passes the same flags, so its listing exercises the same connection budget. ### Current state and specifics `siteDeploy` in `cmd/allod/site.go` builds `syncArgs` as `sync <store path> <docroot>`, the profile's `--filter-from`, `--backup-dir`, and `--verbose`, then `--dry-run` when asked. rclone's defaults fill the rest: four transfers, eight checkers, and the FTP backend's `concurrency` of 0, unlimited. Directory listing during the check phase is what opens connections in parallel; with the store-path timestamps honoured by the host, the transfer set of a typical deploy is small and the listings still exceed the limit (allod/tools#184). The flags belong in the deploy's own argv, next to `--backup-dir`, rather than in the rclone config stanza: the stanza is the credential, placed by agenix and rotated by `rotate-token`, and its parser accepts exactly the five keys `allod site config` writes. ### Scope In: the three flags in `siteDeploy`'s sync argv, the test that pins them, and one sentence in the deploy detail prose saying the sync is connection-bounded. Out: making the numbers a hosting-profile field (trigger: a host whose limit the fixed values do not fit), and `check`, which opens one connection.
vnprc closed this issue 2026-09-10 21:56:23 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
allod/tools#186
No description provided.