Skip to content

Avoid 100% CPU usage while socket is closed #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 31, 2020
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ python:
- 2.7
- 3.4
- 3.7
- 3.8
- pypy2.7-6.0

env:
Expand Down
2 changes: 1 addition & 1 deletion docs/compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Although kafka-python is tested and expected to work on recent broker versions,
not all features are supported. Specifically, authentication codecs, and
transactional producer/consumer support are not fully implemented. PRs welcome!

kafka-python is tested on python 2.7, 3.4, 3.7, and pypy2.7.
kafka-python is tested on python 2.7, 3.4, 3.7, 3.8 and pypy2.7.

Builds and tests via Travis-CI. See https://travis-ci.org/dpkp/kafka-python
3 changes: 3 additions & 0 deletions kafka/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ def _poll(self, timeout):
self._sensors.select_time.record((end_select - start_select) * 1000000000)

for key, events in ready:
if key.fileobj.fileno() < 0:
self._selector.unregister(key.fileobj)

if key.fileobj is self._wake_r:
self._clear_wake_fd()
continue
Expand Down
8 changes: 4 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
flake8==3.4.1
pytest==3.10.0
pytest-cov==2.6.0
pytest==5.4.3
pytest-cov==2.10.0
docker-py==1.10.6
coveralls==1.5.1
Sphinx==1.6.4
Expand All @@ -9,8 +9,8 @@ xxhash==1.3.0
python-snappy==0.5.3
tox==3.5.3
mock==3.0.5
pylint==1.9.3
pytest-pylint==0.12.3
pylint==2.5.3
pytest-pylint==0.17.0
pytest-mock==1.10.0
sphinx-rtd-theme==0.2.4
crc32c==1.7
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def run(cls):
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
]
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{26,27,34,35,36,37,py}, docs
envlist = py{26,27,34,35,36,37,38,py}, docs

[pytest]
testpaths = kafka test
Expand All @@ -8,10 +8,10 @@ log_format = %(created)f %(filename)-23s %(threadName)s %(message)s

[testenv]
deps =
pytest<4.0
pytest
pytest-cov
py{27,34,35,36,37,py}: pylint
py{27,34,35,36,37,py}: pytest-pylint
py{27,34,35,36,37,38,py}: pylint
py{27,34,35,36,37,38,py}: pytest-pylint
pytest-mock
mock
python-snappy
Expand Down