From 9c69b45204dbd4e51c187ba71f249f8d76400698 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 1/2] connection_pool: fix excessive idle CPU usage while waiting for requests --- CHANGELOG.md | 4 ++++ tarantool/connection_pool.py | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8edd47e7..6e067549 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Drop Python 3.6 support (PR #327). +### Fixed +- Reduce idle CPU usage in `ConnectionPool` while waiting for + queued requests (PR #336). + ## 1.2.0 - 2024-03-27 ### Added 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) From a60c046f5d75d1b352f2d3ebefc93cf79c231f07 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: Mon, 22 Jun 2026 19:52:47 +0300 Subject: [PATCH 2/2] readthedocs: bump build.os to ubuntu-24.04 --- .readthedocs.yaml | 2 +- CHANGELOG.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index bc990993..7561bbea 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,7 +1,7 @@ version: 2 build: - os: "ubuntu-20.04" + os: "ubuntu-24.04" tools: python: "3.10" jobs: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e067549..ee087130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Reduce idle CPU usage in `ConnectionPool` while waiting for queued requests (PR #336). +- Bump readthedocs build os version to ubuntu-24.04 (PR #336). + Ubuntu-20.04 is no longer supported. ## 1.2.0 - 2024-03-27