diff --git a/ydb/_grpc/grpcwrapper/common_utils.py b/ydb/_grpc/grpcwrapper/common_utils.py index 347375b8..1e41f4a5 100644 --- a/ydb/_grpc/grpcwrapper/common_utils.py +++ b/ydb/_grpc/grpcwrapper/common_utils.py @@ -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 + 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)