Skip to content

Commit 94ca12d

Browse files
committed
Remove connection from pool before waiting for results
1 parent 3e31475 commit 94ca12d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ydb/aio/connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ async def connection_ready(self, ready_timeout=10):
227227

228228
await asyncio.wait_for(self._channel.channel_ready(), timeout=ready_timeout)
229229

230-
async def close(self, grace: float = None):
230+
async def close(self, grace: float = 30):
231231
"""
232232
Closes the underlying gRPC channel
233233
:param: grace: If a grace period is specified, this method wait until all active
@@ -239,12 +239,12 @@ async def close(self, grace: float = None):
239239

240240
self.closing = True
241241

242-
if self.calls:
243-
await asyncio.wait(self.calls.values(), timeout=grace)
244-
245242
for callback in self._cleanup_callbacks:
246243
callback(self)
247244

245+
if self.calls:
246+
await asyncio.wait(self.calls.values(), timeout=grace)
247+
248248
await self.destroy()
249249

250250
async def __aenter__(self):

0 commit comments

Comments
 (0)