From 8e2a62c296736bedbbabeeb8152488d17d6452a1 Mon Sep 17 00:00:00 2001 From: robot-piglet Date: Tue, 14 Jan 2025 11:23:02 +0300 Subject: Intermediate changes commit_hash:15d56dd66952b13618965762cefcdb4484050ee4 --- contrib/python/ydb/py3/.dist-info/METADATA | 2 +- contrib/python/ydb/py3/ya.make | 2 +- contrib/python/ydb/py3/ydb/aio/table.py | 9 ++++++++- contrib/python/ydb/py3/ydb/query/transaction.py | 2 +- contrib/python/ydb/py3/ydb/ydb_version.py | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) (limited to 'contrib/python') diff --git a/contrib/python/ydb/py3/.dist-info/METADATA b/contrib/python/ydb/py3/.dist-info/METADATA index f20c4f4245f..391e0b3f96f 100644 --- a/contrib/python/ydb/py3/.dist-info/METADATA +++ b/contrib/python/ydb/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ydb -Version: 3.18.12 +Version: 3.18.14 Summary: YDB Python SDK Home-page: http://github.com/ydb-platform/ydb-python-sdk Author: Yandex LLC diff --git a/contrib/python/ydb/py3/ya.make b/contrib/python/ydb/py3/ya.make index 3407713a344..e0f0e9ce8a7 100644 --- a/contrib/python/ydb/py3/ya.make +++ b/contrib/python/ydb/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(3.18.12) +VERSION(3.18.14) LICENSE(Apache-2.0) diff --git a/contrib/python/ydb/py3/ydb/aio/table.py b/contrib/python/ydb/py3/ydb/aio/table.py index aec32e1a26e..538f498ba10 100644 --- a/contrib/python/ydb/py3/ydb/aio/table.py +++ b/contrib/python/ydb/py3/ydb/aio/table.py @@ -563,7 +563,14 @@ class SessionPool: async def _get_session_from_queue(self, timeout: float): task_wait = asyncio.ensure_future(asyncio.wait_for(self._active_queue.get(), timeout=timeout)) task_should_stop = asyncio.ensure_future(self._should_stop.wait()) - done, _ = await asyncio.wait((task_wait, task_should_stop), return_when=asyncio.FIRST_COMPLETED) + try: + done, _ = await asyncio.wait((task_wait, task_should_stop), return_when=asyncio.FIRST_COMPLETED) + except asyncio.CancelledError: + cancelled = task_wait.cancel() + if not cancelled: + priority, session = task_wait.result() + self._active_queue.put_nowait((priority, session)) + raise if task_should_stop in done: task_wait.cancel() return self._create() diff --git a/contrib/python/ydb/py3/ydb/query/transaction.py b/contrib/python/ydb/py3/ydb/query/transaction.py index d9c0dfcb3b6..414401da4d1 100644 --- a/contrib/python/ydb/py3/ydb/query/transaction.py +++ b/contrib/python/ydb/py3/ydb/query/transaction.py @@ -283,7 +283,7 @@ class BaseQueryTxContext: ) def _move_to_beginned(self, tx_id: str) -> None: - if self._tx_state._already_in(QueryTxStateEnum.BEGINED): + if self._tx_state._already_in(QueryTxStateEnum.BEGINED) or not tx_id: return self._tx_state._change_state(QueryTxStateEnum.BEGINED) self._tx_state.tx_id = tx_id diff --git a/contrib/python/ydb/py3/ydb/ydb_version.py b/contrib/python/ydb/py3/ydb/ydb_version.py index 9d48446b091..b40f83ba95b 100644 --- a/contrib/python/ydb/py3/ydb/ydb_version.py +++ b/contrib/python/ydb/py3/ydb/ydb_version.py @@ -1 +1 @@ -VERSION = "3.18.12" +VERSION = "3.18.14" -- cgit v1.3