Skip to content

KAFKA-24599: merge upstream v1.4.7 into mirrored master and fix merge #69

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 7 commits into from
Nov 4, 2019
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: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dist: xenial

python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy2.7-6.0
Expand Down
62 changes: 56 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# 1.4.7 (Sep 30, 2019)

This is a minor release focused on KafkaConsumer performance, Admin Client
improvements, and Client concurrency. The KafkaConsumer iterator implementation
has been greatly simplified so that it just wraps consumer.poll(). The prior
implementation will remain available for a few more releases using the optional
KafkaConsumer config: `legacy_iterator=True` . This is expected to improve
consumer throughput substantially and help reduce heartbeat failures / group
rebalancing.

Client
* Send socket data via non-blocking IO with send buffer (dpkp / PR #1912)
* Rely on socket selector to detect completed connection attempts (dpkp / PR #1909)
* Improve connection lock handling; always use context manager (melor,dpkp / PR #1895)
* Reduce client poll timeout when there are no in-flight requests (dpkp / PR #1823)

KafkaConsumer
* Do not use wakeup when sending fetch requests from consumer (dpkp / PR #1911)
* Wrap `consumer.poll()` for KafkaConsumer iteration (dpkp / PR #1902)
* Allow the coordinator to auto-commit on old brokers (justecorruptio / PR #1832)
* Reduce internal client poll timeout for (legacy) consumer iterator interface (dpkp / PR #1824)
* Use dedicated connection for group coordinator (dpkp / PR #1822)
* Change coordinator lock acquisition order (dpkp / PR #1821)
* Make `partitions_for_topic` a read-through cache (Baisang / PR #1781,#1809)
* Fix consumer hanging indefinitely on topic deletion while rebalancing (commanderdishwasher / PR #1782)

Miscellaneous Bugfixes / Improvements
* Fix crc32c avilability on non-intel architectures (ossdev07 / PR #1904)
* Load system default SSL CAs if `ssl_cafile` is not provided (iAnomaly / PR #1883)
* Catch py3 TimeoutError in BrokerConnection send/recv (dpkp / PR #1820)
* Added a function to determine if bootstrap is successfully connected (Wayde2014 / PR #1876)

Admin Client
* Add ACL api support to KafkaAdminClient (ulrikjohansson / PR #1833)
* Add `sasl_kerberos_domain_name` config to KafkaAdminClient (jeffwidman / PR #1852)
* Update `security_protocol` config documentation for KafkaAdminClient (cardy31 / PR #1849)
* Break FindCoordinator into request/response methods in KafkaAdminClient (jeffwidman / PR #1871)
* Break consumer operations into request / response methods in KafkaAdminClient (jeffwidman / PR #1845)
* Parallelize calls to `_send_request_to_node()` in KafkaAdminClient (davidheitman / PR #1807)

Test Infrastructure / Documentation / Maintenance
* Add Kafka 2.3.0 to test matrix and compatibility docs (dpkp / PR #1915)
* Convert remaining `KafkaConsumer` tests to `pytest` (jeffwidman / PR #1886)
* Bump integration tests to 0.10.2.2 and 0.11.0.3 (jeffwidman / #1890)
* Cleanup handling of `KAFKA_VERSION` env var in tests (jeffwidman / PR #1887)
* Minor test cleanup (jeffwidman / PR #1885)
* Use `socket.SOCK_STREAM` in test assertions (iv-m / PR #1879)
* Sanity test for `consumer.topics()` and `consumer.partitions_for_topic()` (Baisang / PR #1829)
* Cleanup seconds conversion in client poll timeout calculation (jeffwidman / PR #1825)
* Remove unused imports (jeffwidman / PR #1808)
* Cleanup python nits in RangePartitionAssignor (jeffwidman / PR #1805)
* Update links to kafka consumer config docs (jeffwidman)
* Fix minor documentation typos (carsonip / PR #1865)
* Remove unused/weird comment line (jeffwidman / PR #1813)
* Update docs for `api_version_auto_timeout_ms` (jeffwidman / PR #1812)

# 1.4.6.post2 (Aug 27, 2019)
* Cherrypick change from upstream to make blocking calls for Kafka metadata if we don't have any

Expand All @@ -11,9 +67,7 @@ we only build for versions 0.10.2.2 and 1.1.0 and 1.1.1
This is a patch release primarily focused on bugs related to concurrency,
SSL connections and testing, and SASL authentication:


Client Concurrency Issues (Race Conditions / Deadlocks)

* Fix race condition in `protocol.send_bytes` (isamaru / PR #1752)
* Do not call `state_change_callback` with lock (dpkp / PR #1775)
* Additional BrokerConnection locks to synchronize protocol/IFR state (dpkp / PR #1768)
Expand All @@ -22,12 +76,10 @@ Client Concurrency Issues (Race Conditions / Deadlocks)
* Hold lock during `client.check_version` (dpkp / PR #1771)

Producer Wakeup / TimeoutError

* Dont wakeup during `maybe_refresh_metadata` -- it is only called by poll() (dpkp / PR #1769)
* Dont do client wakeup when sending from sender thread (dpkp / PR #1761)

SSL - Python3.7 Support / Bootstrap Hostname Verification / Testing

* Wrap SSL sockets after connecting for python3.7 compatibility (dpkp / PR #1754)
* Allow configuration of SSL Ciphers (dpkp / PR #1755)
* Maintain shadow cluster metadata for bootstrapping (dpkp / PR #1753)
Expand All @@ -36,13 +88,11 @@ SSL - Python3.7 Support / Bootstrap Hostname Verification / Testing
* Reset reconnect backoff on SSL connection (dpkp / PR #1777)

SASL - OAuthBearer support / api version bugfix

* Fix 0.8.2 protocol quick detection / fix SASL version check (dpkp / PR #1763)
* Update sasl configuration docstrings to include supported mechanisms (dpkp)
* Support SASL OAuthBearer Authentication (pt2pham / PR #1750)

Miscellaneous Bugfixes

* Dont force metadata refresh when closing unneeded bootstrap connections (dpkp / PR #1773)
* Fix possible AttributeError during conn._close_socket (dpkp / PR #1776)
* Return connection state explicitly after close in connect() (dpkp / PR #1778)
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Kafka Python client
------------------------

.. image:: https://img.shields.io/badge/kafka-1.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
.. image:: https://img.shields.io/badge/kafka-2.3%2C%202.2%2C%202.1%2C%202.0%2C%201.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
:target: https://kafka-python.readthedocs.io/compatibility.html
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
:target: https://pypi.python.org/pypi/kafka-python
Expand Down Expand Up @@ -150,7 +150,7 @@ for interacting with kafka brokers via the python repl. This is useful for
testing, probing, and general experimentation. The protocol support is
leveraged to enable a KafkaClient.check_version() method that
probes a kafka broker and attempts to identify which version it is running
(0.8.0 to 1.1+).
(0.8.0 to 2.3+).

Low-level
*********
Expand Down
2 changes: 1 addition & 1 deletion build_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
: ${KAFKA_SRC_GIT:=https://github.com/apache/kafka.git}

# On travis CI, empty KAFKA_VERSION means skip integration tests
# so we don't try to get binaries
# so we don't try to get binaries
# Otherwise it means test all official releases, so we get all of them!
if [ -z "$KAFKA_VERSION" -a -z "$TRAVIS" ]; then
KAFKA_VERSION=$ALL_RELEASES
Expand Down
63 changes: 63 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,69 @@ Logging / Error Messages
* Log Heartbeat thread start / close for debugging (dpkp)


1.4.7 (Sep 30, 2019)
####################

This is a minor release focused on KafkaConsumer performance, Admin Client
improvements, and Client concurrency. The KafkaConsumer iterator implementation
has been greatly simplified so that it just wraps consumer.poll(). The prior
implementation will remain available for a few more releases using the optional
KafkaConsumer config: `legacy_iterator=True` . This is expected to improve
consumer throughput substantially and help reduce heartbeat failures / group
rebalancing.

Client
------
* Send socket data via non-blocking IO with send buffer (dpkp / PR #1912)
* Rely on socket selector to detect completed connection attempts (dpkp / PR #1909)
* Improve connection lock handling; always use context manager (melor,dpkp / PR #1895)
* Reduce client poll timeout when there are no in-flight requests (dpkp / PR #1823)

KafkaConsumer
-------------
* Do not use wakeup when sending fetch requests from consumer (dpkp / PR #1911)
* Wrap `consumer.poll()` for KafkaConsumer iteration (dpkp / PR #1902)
* Allow the coordinator to auto-commit on old brokers (justecorruptio / PR #1832)
* Reduce internal client poll timeout for (legacy) consumer iterator interface (dpkp / PR #1824)
* Use dedicated connection for group coordinator (dpkp / PR #1822)
* Change coordinator lock acquisition order (dpkp / PR #1821)
* Make `partitions_for_topic` a read-through cache (Baisang / PR #1781,#1809)
* Fix consumer hanging indefinitely on topic deletion while rebalancing (commanderdishwasher / PR #1782)

Miscellaneous Bugfixes / Improvements
-------------------------------------
* Fix crc32c avilability on non-intel architectures (ossdev07 / PR #1904)
* Load system default SSL CAs if `ssl_cafile` is not provided (iAnomaly / PR #1883)
* Catch py3 TimeoutError in BrokerConnection send/recv (dpkp / PR #1820)
* Added a function to determine if bootstrap is successfully connected (Wayde2014 / PR #1876)

Admin Client
------------
* Add ACL api support to KafkaAdminClient (ulrikjohansson / PR #1833)
* Add `sasl_kerberos_domain_name` config to KafkaAdminClient (jeffwidman / PR #1852)
* Update `security_protocol` config documentation for KafkaAdminClient (cardy31 / PR #1849)
* Break FindCoordinator into request/response methods in KafkaAdminClient (jeffwidman / PR #1871)
* Break consumer operations into request / response methods in KafkaAdminClient (jeffwidman / PR #1845)
* Parallelize calls to `_send_request_to_node()` in KafkaAdminClient (davidheitman / PR #1807)

Test Infrastructure / Documentation / Maintenance
-------------------------------------------------
* Add Kafka 2.3.0 to test matrix and compatibility docs (dpkp / PR #1915)
* Convert remaining `KafkaConsumer` tests to `pytest` (jeffwidman / PR #1886)
* Bump integration tests to 0.10.2.2 and 0.11.0.3 (jeffwidman / #1890)
* Cleanup handling of `KAFKA_VERSION` env var in tests (jeffwidman / PR #1887)
* Minor test cleanup (jeffwidman / PR #1885)
* Use `socket.SOCK_STREAM` in test assertions (iv-m / PR #1879)
* Sanity test for `consumer.topics()` and `consumer.partitions_for_topic()` (Baisang / PR #1829)
* Cleanup seconds conversion in client poll timeout calculation (jeffwidman / PR #1825)
* Remove unused imports (jeffwidman / PR #1808)
* Cleanup python nits in RangePartitionAssignor (jeffwidman / PR #1805)
* Update links to kafka consumer config docs (jeffwidman)
* Fix minor documentation typos (carsonip / PR #1865)
* Remove unused/weird comment line (jeffwidman / PR #1813)
* Update docs for `api_version_auto_timeout_ms` (jeffwidman / PR #1812)


1.4.6 (Apr 2, 2019)
###################

Expand Down
10 changes: 7 additions & 3 deletions docs/compatibility.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
Compatibility
-------------

.. image:: https://img.shields.io/badge/kafka-1.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
.. image:: https://img.shields.io/badge/kafka-2.3%2C%202.2%2C%202.1%2C%202.0%2C%201.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
:target: https://kafka-python.readthedocs.io/compatibility.html
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
:target: https://pypi.python.org/pypi/kafka-python

kafka-python is compatible with (and tested against) broker versions 1.1
kafka-python is compatible with (and tested against) broker versions 2.3
through 0.8.0 . kafka-python is not compatible with the 0.8.2-beta release.

Because the kafka server protocol is backwards compatible, kafka-python is
expected to work with newer broker releases as well (2.0+).
expected to work with newer broker releases as well.

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.

Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kafka-python
############

.. image:: https://img.shields.io/badge/kafka-1.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
.. image:: https://img.shields.io/badge/kafka-2.3%2C%202.2%2C%202.1%2C%202.0%2C%201.1%2C%201.0%2C%200.11%2C%200.10%2C%200.9%2C%200.8-brightgreen.svg
:target: https://kafka-python.readthedocs.io/compatibility.html
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
:target: https://pypi.python.org/pypi/kafka-python
Expand Down Expand Up @@ -136,7 +136,7 @@ for interacting with kafka brokers via the python repl. This is useful for
testing, probing, and general experimentation. The protocol support is
leveraged to enable a :meth:`~kafka.KafkaClient.check_version()`
method that probes a kafka broker and
attempts to identify which version it is running (0.8.0 to 1.1+).
attempts to identify which version it is running (0.8.0 to 2.3+).


Low-level
Expand Down
6 changes: 5 additions & 1 deletion kafka/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

from kafka.admin.config_resource import ConfigResource, ConfigResourceType
from kafka.admin.client import KafkaAdminClient
from kafka.admin.acl_resource import (ACL, ACLFilter, ResourcePattern, ResourcePatternFilter, ACLOperation,
ResourceType, ACLPermissionType, ACLResourcePatternType)
from kafka.admin.new_topic import NewTopic
from kafka.admin.new_partitions import NewPartitions

__all__ = [
'ConfigResource', 'ConfigResourceType', 'KafkaAdminClient', 'NewTopic', 'NewPartitions'
'ConfigResource', 'ConfigResourceType', 'KafkaAdminClient', 'NewTopic', 'NewPartitions', 'ACL', 'ACLFilter',
'ResourcePattern', 'ResourcePatternFilter', 'ACLOperation', 'ResourceType', 'ACLPermissionType',
'ACLResourcePatternType'
]
Loading