diff --git a/ydb/_grpc/grpcwrapper/common_utils.py b/ydb/_grpc/grpcwrapper/common_utils.py index 7fb5b684..0dff5575 100644 --- a/ydb/_grpc/grpcwrapper/common_utils.py +++ b/ydb/_grpc/grpcwrapper/common_utils.py @@ -174,7 +174,12 @@ async def start(self, driver: SupportedDriverType, stub, method): def close(self): 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 + self._stream_call.cancel() + elif hasattr(self._stream_call, "close"): + # for OpenTelemetry intercepted grpc calls (generator) + self._stream_call.close() self._clean_executor(wait=True)