diff --git a/ydb/_grpc/grpcwrapper/common_utils.py b/ydb/_grpc/grpcwrapper/common_utils.py index 1e9e83ca..a7058048 100644 --- a/ydb/_grpc/grpcwrapper/common_utils.py +++ b/ydb/_grpc/grpcwrapper/common_utils.py @@ -161,7 +161,7 @@ def __init__(self, convert_server_grpc_to_wrapper): self._wait_executor = None def __del__(self): - self._wait_executor.shutdown(wait=False) + self._clean_executor(wait=False) async def start(self, driver: SupportedDriverType, stub, method): if asyncio.iscoroutinefunction(driver.__call__): @@ -175,11 +175,11 @@ def close(self): if self._stream_call: self._stream_call.cancel() - self._clean_executor() + self._clean_executor(wait=True) - def _clean_executor(self): + def _clean_executor(self, wait: bool): if self._wait_executor: - self._wait_executor.shutdown() + self._wait_executor.shutdown(wait) async def _start_asyncio_driver(self, driver: ydb.aio.Driver, stub, method): requests_iterator = QueueToIteratorAsyncIO(self.from_client_grpc)