Documentation
¶
Overview ¶
Package httpretry decides which failed HTTP attempts are worth repeating.
It exists because a single unlucky draw against a flaky host loses a recipe for a whole factory run. Measured on one 23-failure batch, ELEVEN were transient HTTP and nothing else:
x.org (×7) dial tcp 131.252.210.176:443: i/o timeout gnu.org/gmp dial tcp 130.242.124.102:443: i/o timeout pkg-config dial tcp 131.252.210.176:443: i/o timeout freetype.org 502 Bad Gateway ijg.org 503 Service Temporarily Unavailable
xorg.freedesktop.org is not down — three consecutive requests from a second machine answered 200 in 8.2s, 200 in 2.4s, then timed out. It is flaky, and a factory that gives a flaky host exactly one chance reports its own bad luck as a broken recipe.
The distinction that matters is transient versus answered. A 403 or a 404 is the server telling you something true; repeating it wastes time and hides the real message. A timeout, a reset, or a 5xx is the server failing to answer at all.
Index ¶
Constants ¶
const Attempts = 3
Attempts is how many times a transient failure is retried before giving up. Three attempts spans ~3s of backoff, which covers the flakiness measured above without turning a genuinely dead host into a slow build.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.