Skip to content

Conversation

@jjpinto
Copy link

@jjpinto jjpinto commented Jan 24, 2026

sendCountRequest() never closed resp.Body, causing file descriptor and connection leaks under load. This eventually leads to "too many open files" and stalled requests.

The retry loop also hammered the server with no delay on non-204 responses. A small backoff prevents excessive CPU and network usage.

This makes the exactly-once example more reliable and prevents false failures.

Fix #664

sendCountRequest() never closed resp.Body, causing file descriptor and
connection leaks under load. This eventually leads to "too many open files"
and stalled requests.

The retry loop also hammered the server with no delay on non-204 responses.
A small backoff prevents excessive CPU and network usage.

This makes the exactly-once example more reliable and prevents false failures.

Fix ThreeDotsLabs#664
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.

run.go: HTTP response body leak and potential goroutine deadlock

1 participant