Add note about http client ownership to client docstrings#298
Merged
Conversation
Collaborator
|
Thanks @dongjiang1989 - some questions |
anuraaga
reviewed
Jul 11, 2026
dongjiang1989
force-pushed
the
fix-sync-close
branch
from
July 13, 2026 06:10
6d5d974 to
8cb2104
Compare
dongjiang1989
added a commit
to dongjiang1989/connect-py
that referenced
this pull request
Jul 13, 2026
- Remove HTTP client close logic: the underlying HTTP client may be shared (default shared client or user-provided), so we should not close it. Just mark the connect client as closed. - Remove stream.aclose() from _consume_single_response: the generator is a private implementation detail and cleanup is handled elsewhere. - Fix EM101: extract RuntimeError message to variable. - Update tests to match new behavior. Addresses review comments on PR connectrpc#298. Signed-off-by: dongjiang <dongjiang1989@126.com>
dongjiang1989
added a commit
to dongjiang1989/connect-py
that referenced
this pull request
Jul 13, 2026
The connect client's close() method only marks the client as closed. Users who provide their own HTTP client are responsible for closing it themselves. Add documentation and examples to clarify this. Addresses review feedback on PR connectrpc#298. Signed-off-by: dongjiang <dongjiang1989@126.com>
dongjiang1989
force-pushed
the
fix-sync-close
branch
from
July 13, 2026 07:23
7925da3 to
1095826
Compare
The connect client's close() method only marks the client as closed. Users who provide their own HTTP client are responsible for closing it themselves. Add documentation and examples to clarify this. Addresses review feedback on PR connectrpc#298. Signed-off-by: dongjiang <dongjiang1989@126.com>
dongjiang1989
force-pushed
the
fix-sync-close
branch
from
July 13, 2026 07:45
1095826 to
3a168a8
Compare
Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
Collaborator
|
Thanks @dongjiang1989 - I have moved the docs to the constructor and used context manager |
anuraaga
approved these changes
Jul 14, 2026
dongjiang1989
added a commit
to dongjiang1989/connect-py
that referenced
this pull request
Jul 14, 2026
The connect client's close() method only marks the client as closed. Users who provide their own HTTP client are responsible for closing it themselves. Add documentation and examples to clarify this. Addresses review feedback on PR connectrpc#298. Signed-off-by: dongjiang <dongjiang1989@126.com>
dongjiang1989
force-pushed
the
fix-sync-close
branch
from
July 14, 2026 02:08
cd9b999 to
b686035
Compare
Contributor
Author
|
Thanks @anuraaga |
Collaborator
|
@dongjiang1989 Please don't force-push after I've cleaned up / approved. I restored to my state and will merge after CI again |
Contributor
Author
Got it. |
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
close()now calls the underlying HTTP client'sclose()/aclose()to release connection pool resources (with graceful fallback when the method is not available on the HTTP client)execute_*methods now raiseRuntimeErrorwhen called on a closed client_consume_single_responseensuresstream.aclose()is called in afinallyblock to prevent async generator resource leaks_check_closed()helper to avoid duplication across execute methodsTest plan
test/test_client_close.pycovering all three fixes (13 tests)test_example.py)