Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ydb/_grpc/grpcwrapper/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,12 @@ async def start(self, driver: SupportedDriverType, stub: Any, method: str) -> No
def close(self) -> None:
self.from_client_grpc.put_nowait(_stop_grpc_connection_marker)
if self._stream_call:
self._stream_call.cancel()
if hasattr(self._stream_call, "cancel"):
# for ordinal grpc calls
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "ordinal grpc calls"; "ordinal" is a spelling/word-choice error here (it means positional/ranked). Consider changing it to "ordinary" or "regular" to avoid confusion.

Suggested change
# for ordinal grpc calls
# for ordinary grpc calls

Copilot uses AI. Check for mistakes.
self._stream_call.cancel()
elif hasattr(self._stream_call, "close"):
# for OpenTelemetry intercepted grpc calls (generator)
self._stream_call.close()
Comment on lines 198 to +206
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close() now conditionally calls cancel() vs close() depending on what the intercepted stream object provides, but there’s no unit test covering this regression scenario. Please add a small test that sets _stream_call to a mock object exposing only close() (and no cancel()), calls GrpcWrapperAsyncIO.close(), and asserts close() was invoked (and the method does not raise).

Copilot uses AI. Check for mistakes.

self._clean_executor(wait=True)

Expand Down
Loading