Skip to content

fix: retry safe federation reads once on transport failure#236

Merged
sufforest merged 1 commit into
mainfrom
wzy/federation-get-retry
Jul 4, 2026
Merged

fix: retry safe federation reads once on transport failure#236
sufforest merged 1 commit into
mainfrom
wzy/federation-get-retry

Conversation

@sufforest

Copy link
Copy Markdown
Owner

The recurring msc3902 Complement flakes were outbound make_join and the partial-state filler's /state(_ids) GETs failing the whole join on a single transport blip — a reset on a fresh connect, or a keep-alive connection the peer closed while idle in reqwest's pool. signed_request never retried, so one blip 403'd the partial-state join ("all resident-server hints failed").

Now retries once on a send/body error for safe methods only (is_safe(), not is_idempotent(): send_join is a PUT, claim_user_keys a POST that burns an OTK). A parseable non-2xx is the peer's real answer and isn't retried. Also caps connect at 10s so the retry can't stretch a black-holing peer to 60s.

Regression test in tests/federation_get_retries.rs (safe GET → 2 attempts, unsafe PUT → 1).

make_join and the partial-state filler's /state(_ids) GETs 403'd the
whole join on a single transport blip — a reset on a fresh connect or a
keep-alive connection the peer closed while idle in reqwest's pool —
because signed_request never retried. that was the main recurring
msc3902 Complement flake.

now retries once on a send/body error for safe methods only (is_safe(),
not is_idempotent(): send_join is a PUT, claim_user_keys a POST that
burns an OTK). a parseable non-2xx is the peer's real answer, not
retried. also caps connect at 10s so the retry can't stretch a
black-holing peer to 60s.
@sufforest sufforest merged commit 5d655c2 into main Jul 4, 2026
11 checks passed
@sufforest sufforest deleted the wzy/federation-get-retry branch July 4, 2026 08:23
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