fix: retry safe federation reads once on transport failure#236
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The recurring msc3902 Complement flakes were outbound
make_joinand 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_requestnever 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(), notis_idempotent():send_joinis a PUT,claim_user_keysa 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).