-
Notifications
You must be signed in to change notification settings - Fork 62
Description
I'm using asyncio and when there's an error in one coroutine, that exception is propagated to top level and session pool is stopped. However, since I'm using asyncio.gather other coroutines are not cancelled and they keep running. However when SessionPool is stopped SessionPool.checkout keeps returning uninitialized sessions instead of raising some sensible exception, which causes all attempts to run queries with that session to fail with BadSession. This is a retriable exception, so my code keeps spinning in retries.
When using a very large number for max_retries in RetrySettings this would keep spinning until something else fails, which may be essentially never.
I think SessionPool.checkout should throw some non-retriable error when SessionPool is stopped and there is no chance to get a valid session: https://github.com/ydb-platform/ydb-python-sdk/blob/main/ydb/aio/table.py#L344