fix(migrator): retry failed writes serially
CI / test (push) Canceled after 0s

Pass-B writes (issue body rewrite + each comment) ran only at the
caller's --concurrency, so a transient target 5xx either aborted the
run or silently lost the write. A self-hosted Gitea throws bursts of
500s under concurrent writes, losing comments and leaving bodies with
stale cross-refs.

Failed writes are now deferred and replayed once serially (concurrency
1) after the concurrent wave -- serial load removes the backpressure
causing the 500s, so nearly all recover. Writes still failing serially
are logged and skipped; a genuinely-down target still aborts via
CircuitOpenError.

Adds two phase tests: persistent-fail (no abort) and transient (recover).
This commit is contained in:
AlexKucera committed 2026-08-13 16:10:10 +02:00
1 parent 8449a2bd81
commit e6fc0c7fb9
4 files changed
+167 -12

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file. The format
- **client:** add full jitter to the retry backoff and a larger, write-aware timeout (`httpx.Timeout(read=600, write=600)`) for bulk asset transfers so large binaries stop timing out mid-transfer and re-uploading from scratch.
- **migrator:** log unparseable pull refs instead of dropping them silently.
- **ci:** enable the uv download cache (`setup-python` `cache: uv`) so warm runs skip re-fetching deps; installs stay `--frozen`/hash-verified.
- **migrator:** defer-and-serially-retry Pass-B writes (issue body/title rewrites and each comment) that hit a transient target 5xx. Concurrent writes are what overstress a self-hosted Gitea into bursts of 500s, so a run either aborted or silently lost comments and left issue bodies with stale cross-refs. Failed writes are now deferred during the concurrent pass and replayed once serially (concurrency 1) afterwards — serial load removes the backpressure causing the 500s, so nearly all recover. Writes still failing serially are logged and skipped; a genuinely-down target still aborts via `CircuitOpenError`.
### refactor