Skip to content
Merged
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Set upper bound for version of setuptools (PR #342).
- Reduce idle CPU usage in `ConnectionPool` while waiting for
queued requests (PR #336).

## 1.2.0 - 2024-03-27

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:
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)
Expand Down
Loading