• Stefy Lanza (nextime / spora )'s avatar
    retry policy: bounded per code, not "indefinitely" · d8f1e394
    Stefy Lanza (nextime / spora ) authored
    The previous revision told a client to retry 404 and 502 indefinitely.
    That is wrong and would spin forever in two real cases: a document that
    reliably 502s never succeeds and blocks the corpus behind it, and a 404
    that is not a restart (wrong URL, route removed) never clears. Both end
    with pods billing and nothing being produced -- the exact failure the
    advice was written to prevent.
    
    It was an over-correction. On 2026-10-19 a restart answered 618 requests
    with 404 over ~40 seconds, the client treated 404 as fatal and stopped,
    and nine pods sat ready at $5.31/hr until a human noticed. The fix for
    that is "do not treat 404 as fatal immediately", not "never give up".
    
    What separates the codes is what each says about the server:
    
      429  healthy and full, and it stated when to return -> honour
           Retry-After, no attempt cap, alert if 15 min pass with no page
           completing.
      404  restarting -> retry with backoff for up to 5 minutes, then STOP
           and alert. A route that is gone does not come back by being
           asked again, and a real "no such endpoint" would have answered
           404 to the first request rather than the ten-thousandth.
      502  the pod failed this page -> 5 attempts, then PARK the page and
           move on. ~3-5% of pages 502 at least once; one unparkable
           document must not stop a million-page run.
      400/413  the document is the problem -> park, never retry.
    
    Plus a circuit breaker, which matters more than any per-page rule: stop
    feeding if more than 20% of the last 200 pages ended parked or erroring.
    No per-page policy can see "the fleet is costing money and producing
    nothing"; only the aggregate can.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01KnfkxBpcZ1v6ypRFFyhrVM
    d8f1e394
Name
Last commit
Last update
..
superpowers Loading commit data...
README.md Loading commit data...
admin-forward-auth.md Loading commit data...
chunking.md Loading commit data...
cluster.md Loading commit data...
deepseek-ds4.md Loading commit data...
digesta-field-report-2026-10-15.md Loading commit data...
dtype-auto-selection.md Loading commit data...
expressive-tts.md Loading commit data...
frontend-engine-split.md Loading commit data...
gguf-process-isolation.md Loading commit data...
glm-colibri.md Loading commit data...
install-from-packages.md Loading commit data...
kimi-k3.md Loading commit data...
ktransformers.md Loading commit data...
longcat-video.md Loading commit data...
minimax-h3.md Loading commit data...
modelli-digesta-e-container.md Loading commit data...
ocr-client-throughput-guide.md Loading commit data...
ocr-throughput-measurements-2026-10-18.md Loading commit data...
ocr.md Loading commit data...
orchestrator-runpod-guide.md Loading commit data...
piano-inferenza-su-coderai-prod.md Loading commit data...
process-isolation-plans.md Loading commit data...
reference-projects.md Loading commit data...
remote-execution.md Loading commit data...
reverse-proxy-nginx.md Loading commit data...
runpod-regional-storage-plan.md Loading commit data...
runpod.md Loading commit data...
surya-block-router-plan.md Loading commit data...
tools-as-services.md Loading commit data...
unlimited-ocr-plan.md Loading commit data...
video-compose.md Loading commit data...
vllm.md Loading commit data...
vlm-lora-training-plan.md Loading commit data...
zimage-lora-training.md Loading commit data...