Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streaming: fix reading the last empty chunk #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jbdalido
Copy link

@jbdalido jbdalido commented Jan 14, 2025

Hello! We built a small, straightforward LLM benchmarking tool in Go that sends a large number of concurrent requests through a single openai client.

Issue:

We noticed that connections were repeatedly being re-created instead of reused. By limiting the client to a single connection per host, we discovered that the connection was hanging because the final chunk in a chunked response "0\r\n\r\n" was never read.

Returning false at that moment prevents the last chunk from being processed properly, causing the body to not be properly closed. This fix corrects that typo, ensuring the final chunk is consumed and allowing connections to be reused as intended.

@jbdalido jbdalido requested a review from a team as a code owner January 14, 2025 16:21
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