Skip to content

Commit 3f425bf

Browse files
committed
review fixes
1 parent eb98ede commit 3f425bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ydb/aio/query/pool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ async def acquire(self) -> QuerySession:
6161
done, _ = await asyncio.wait((queue_get, task_stop), return_when=asyncio.FIRST_COMPLETED)
6262
if task_stop in done:
6363
queue_get.cancel()
64-
return await self._create_new_session()
64+
raise RuntimeError("An attempt to take session from closed session pool.")
65+
6566
task_stop.cancel()
6667
session = queue_get.result()
6768

@@ -163,7 +164,7 @@ def __del__(self):
163164
if self._should_stop.is_set() or self._loop.is_closed():
164165
return
165166

166-
self._loop.call_soon(functools.partial(self.stop))
167+
self._loop.call_soon(self.stop)
167168

168169

169170
class SimpleQuerySessionCheckoutAsync:

0 commit comments

Comments
 (0)