Skip to content

Graceful background ping for HTTP client with timeout and backoff#702

Open
maradini77 wants to merge 1 commit intoa16z:masterfrom
maradini77:patch-2
Open

Graceful background ping for HTTP client with timeout and backoff#702
maradini77 wants to merge 1 commit intoa16z:masterfrom
maradini77:patch-2

Conversation

@maradini77
Copy link
Copy Markdown

  • Summary: Replace infinite sleep loop with a managed background pinger that stops automatically, uses request timeouts, and backs off on failures.
  • Changes:
    • Use Weak ref to auto-stop task when client is dropped
    • Add 30s interval, 2s per-request timeout
    • Add exponential backoff with cap (up to 5m)
  • Why: Prevents task leaks, reduces unnecessary traffic, and avoids thundering herds.

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