From e87d413cc930a72cf4591bec79a74756031b9df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC=20=D0=92=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D1=88=D0=BA=D0=B8=D0=BD?= Date: Wed, 15 Apr 2026 22:33:28 +0300 Subject: [PATCH] fix cpu overload with connection_pool --- tarantool/connection_pool.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tarantool/connection_pool.py b/tarantool/connection_pool.py index f1e675b3..1734402a 100644 --- a/tarantool/connection_pool.py +++ b/tarantool/connection_pool.py @@ -660,8 +660,12 @@ def _request_process_loop(self, key, unit, last_refresh): """ while unit.request_processing_enabled: - if not unit.input_queue.empty(): - task = unit.input_queue.get() + try: + task = unit.input_queue.get(timeout=self.refresh_delay) + except queue.Empty: + task = None + + if task: method = getattr(Connection, task.method_name) try: resp = method(unit.conn, *task.args, **task.kwargs)