Skip to content

fix: disable keep alive to avoid stale socket reuse#3471

Merged
ulemons merged 1 commit intomainfrom
fix/disable-keep-alive-tinybird-client
Oct 8, 2025
Merged

fix: disable keep alive to avoid stale socket reuse#3471
ulemons merged 1 commit intomainfrom
fix/disable-keep-alive-tinybird-client

Conversation

@ulemons
Copy link
Contributor

@ulemons ulemons commented Oct 6, 2025

Changes proposed ✍️

What:

  • Introduced a static https.Agent with keepAlive: false.
  • This disables HTTP keep-alive for all outgoing requests in our TinybirdClient.

Why:

  • We observed recurring socket hang up errors caused by stale socket reuse.
  • By disabling keep-alive, each request uses a fresh TCP/TLS connection, preventing the client from reusing sockets that may already have been closed by the server or a load balancer.
  • This should significantly reduce the frequency of connection reset errors.

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.

@ulemons ulemons self-assigned this Oct 6, 2025
@ulemons ulemons added the Bug Created by Linear-GitHub Sync label Oct 6, 2025
@ulemons ulemons marked this pull request as ready for review October 6, 2025 16:10
@ulemons ulemons requested a review from themarolt as a code owner October 6, 2025 16:10
@ulemons ulemons merged commit a2cfcdb into main Oct 8, 2025
14 checks passed
@ulemons ulemons deleted the fix/disable-keep-alive-tinybird-client branch October 8, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants