Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

build:
os: "ubuntu-20.04"
os: "ubuntu-24.04"
tools:
python: "3.10"
jobs:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ 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).
- Bump readthedocs build os version to ubuntu-24.04 (PR #336).
Ubuntu-20.04 is no longer supported.

## 1.2.0 - 2024-03-27

### Added
Expand Down
8 changes: 6 additions & 2 deletions tarantool/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit message codestyle should be something like

connection_pool: fix cpu overload if stale

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated commit message in accordance with code style.

task = unit.input_queue.get(timeout=self.refresh_delay)
except queue.Empty:
task = None
Comment on lines -663 to +666

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a nice fix, let's add a CHANGELOG entry about its effect.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added entry about changes to CHANGELOG.


if task:
method = getattr(Connection, task.method_name)
try:
resp = method(unit.conn, *task.args, **task.kwargs)
Expand Down
Loading