Conversation
|
🧪 Testing To try out this version of the SDK, run: Expires at: Sat, 03 Jan 2026 18:05:20 GMT |
6e7ff01 to
2b9b391
Compare
Co-authored-by: Deirdre Meehan <deirdre.meehan@192.168.1.124> Co-authored-by: Graden Rea <gradenr@users.noreply.github.com>
2b9b391 to
06796ec
Compare
|
🤖 Release is at https://github.com/groq/groq-python/releases/tag/v0.37.1 🌻 |
| yield process_data(data={"data": data, "event": sse.event}, cast_to=cast_to, response=response) | ||
| # The stream needs to be fully consumed to close the response | ||
| for _sse in iterator: | ||
| ... |
There was a problem hiding this comment.
Bug: Response resource leak when exception raised during stream iteration
The removal of the try/finally block that called response.close() (sync) and await response.aclose() (async) creates a resource leak when an APIError is raised during stream iteration. In the old code, the finally block ensured the response was always closed, even on exceptions. The new code only consumes remaining events via for _sse in iterator when the loop exits normally or breaks on [DONE], but this code is never reached if an exception is raised. Users iterating without a context manager will have unclosed responses when errors occur, potentially causing connection pool exhaustion or hanging.
Automated Release PR
0.37.1 (2025-12-04)
Full Changelog: v0.37.0...v0.37.1
Bug Fixes
Chores
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions
Note
Fix streaming hang by fully consuming SSE iterators; update docs to use env var auth; bump to 0.37.1.
src/groq/_streaming.py): Ensure SSE streams are fully consumed after[DONE]by iterating remaining events (sync and async) to prevent hanging.GROQ_API_KEYenvironment variable in examples (incl. aiohttp snippet).0.37.1inpyproject.toml,.release-please-manifest.json, andsrc/groq/_version.py..stats.ymlOpenAPI spec URL.Written by Cursor Bugbot for commit 06796ec. This will update automatically on new commits. Configure here.