Skip to content

Commit 839a16e

Browse files
authored
Merge pull request #69 from Yelp/u/lrudolph/KAFKA-24599_upgrade_to_1_4_7_merge
KAFKA-24599: merge upstream v1.4.7 into mirrored master and fix merge
2 parents a907306 + ea29750 commit 839a16e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1920
-959
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ dist: xenial
44

55
python:
66
- 2.7
7-
- 3.4
87
- 3.5
98
- 3.6
109
- pypy2.7-6.0

CHANGES.md

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,59 @@
1+
# 1.4.7 (Sep 30, 2019)
2+
3+
This is a minor release focused on KafkaConsumer performance, Admin Client
4+
improvements, and Client concurrency. The KafkaConsumer iterator implementation
5+
has been greatly simplified so that it just wraps consumer.poll(). The prior
6+
implementation will remain available for a few more releases using the optional
7+
KafkaConsumer config: `legacy_iterator=True` . This is expected to improve
8+
consumer throughput substantially and help reduce heartbeat failures / group
9+
rebalancing.
10+
11+
Client
12+
* Send socket data via non-blocking IO with send buffer (dpkp / PR #1912)
13+
* Rely on socket selector to detect completed connection attempts (dpkp / PR #1909)
14+
* Improve connection lock handling; always use context manager (melor,dpkp / PR #1895)
15+
* Reduce client poll timeout when there are no in-flight requests (dpkp / PR #1823)
16+
17+
KafkaConsumer
18+
* Do not use wakeup when sending fetch requests from consumer (dpkp / PR #1911)
19+
* Wrap `consumer.poll()` for KafkaConsumer iteration (dpkp / PR #1902)
20+
* Allow the coordinator to auto-commit on old brokers (justecorruptio / PR #1832)
21+
* Reduce internal client poll timeout for (legacy) consumer iterator interface (dpkp / PR #1824)
22+
* Use dedicated connection for group coordinator (dpkp / PR #1822)
23+
* Change coordinator lock acquisition order (dpkp / PR #1821)
24+
* Make `partitions_for_topic` a read-through cache (Baisang / PR #1781,#1809)
25+
* Fix consumer hanging indefinitely on topic deletion while rebalancing (commanderdishwasher / PR #1782)
26+
27+
Miscellaneous Bugfixes / Improvements
28+
* Fix crc32c avilability on non-intel architectures (ossdev07 / PR #1904)
29+
* Load system default SSL CAs if `ssl_cafile` is not provided (iAnomaly / PR #1883)
30+
* Catch py3 TimeoutError in BrokerConnection send/recv (dpkp / PR #1820)
31+
* Added a function to determine if bootstrap is successfully connected (Wayde2014 / PR #1876)
32+
33+
Admin Client
34+
* Add ACL api support to KafkaAdminClient (ulrikjohansson / PR #1833)
35+
* Add `sasl_kerberos_domain_name` config to KafkaAdminClient (jeffwidman / PR #1852)
36+
* Update `security_protocol` config documentation for KafkaAdminClient (cardy31 / PR #1849)
37+
* Break FindCoordinator into request/response methods in KafkaAdminClient (jeffwidman / PR #1871)
38+
* Break consumer operations into request / response methods in KafkaAdminClient (jeffwidman / PR #1845)
39+
* Parallelize calls to `_send_request_to_node()` in KafkaAdminClient (davidheitman / PR #1807)
40+
41+
Test Infrastructure / Documentation / Maintenance
42+
* Add Kafka 2.3.0 to test matrix and compatibility docs (dpkp / PR #1915)
43+
* Convert remaining `KafkaConsumer` tests to `pytest` (jeffwidman / PR #1886)
44+
* Bump integration tests to 0.10.2.2 and 0.11.0.3 (jeffwidman / #1890)
45+
* Cleanup handling of `KAFKA_VERSION` env var in tests (jeffwidman / PR #1887)
46+
* Minor test cleanup (jeffwidman / PR #1885)
47+
* Use `socket.SOCK_STREAM` in test assertions (iv-m / PR #1879)
48+
* Sanity test for `consumer.topics()` and `consumer.partitions_for_topic()` (Baisang / PR #1829)
49+
* Cleanup seconds conversion in client poll timeout calculation (jeffwidman / PR #1825)
50+
* Remove unused imports (jeffwidman / PR #1808)
51+
* Cleanup python nits in RangePartitionAssignor (jeffwidman / PR #1805)
52+
* Update links to kafka consumer config docs (jeffwidman)
53+
* Fix minor documentation typos (carsonip / PR #1865)
54+
* Remove unused/weird comment line (jeffwidman / PR #1813)
55+
* Update docs for `api_version_auto_timeout_ms` (jeffwidman / PR #1812)
56+
157
# 1.4.6.post2 (Aug 27, 2019)
258
* Cherrypick change from upstream to make blocking calls for Kafka metadata if we don't have any
359

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

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

2478
Producer Wakeup / TimeoutError
25-
2679
* Dont wakeup during `maybe_refresh_metadata` -- it is only called by poll() (dpkp / PR #1769)
2780
* Dont do client wakeup when sending from sender thread (dpkp / PR #1761)
2881

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

3890
SASL - OAuthBearer support / api version bugfix
39-
4091
* Fix 0.8.2 protocol quick detection / fix SASL version check (dpkp / PR #1763)
4192
* Update sasl configuration docstrings to include supported mechanisms (dpkp)
4293
* Support SASL OAuthBearer Authentication (pt2pham / PR #1750)
4394

4495
Miscellaneous Bugfixes
45-
4696
* Dont force metadata refresh when closing unneeded bootstrap connections (dpkp / PR #1773)
4797
* Fix possible AttributeError during conn._close_socket (dpkp / PR #1776)
4898
* Return connection state explicitly after close in connect() (dpkp / PR #1778)

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Kafka Python client
22
------------------------
33

4-
.. 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
4+
.. 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
55
:target: https://kafka-python.readthedocs.io/compatibility.html
66
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
77
:target: https://pypi.python.org/pypi/kafka-python
@@ -150,7 +150,7 @@ for interacting with kafka brokers via the python repl. This is useful for
150150
testing, probing, and general experimentation. The protocol support is
151151
leveraged to enable a KafkaClient.check_version() method that
152152
probes a kafka broker and attempts to identify which version it is running
153-
(0.8.0 to 1.1+).
153+
(0.8.0 to 2.3+).
154154

155155
Low-level
156156
*********

build_integration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
: ${KAFKA_SRC_GIT:=https://github.com/apache/kafka.git}
77

88
# On travis CI, empty KAFKA_VERSION means skip integration tests
9-
# so we don't try to get binaries
9+
# so we don't try to get binaries
1010
# Otherwise it means test all official releases, so we get all of them!
1111
if [ -z "$KAFKA_VERSION" -a -z "$TRAVIS" ]; then
1212
KAFKA_VERSION=$ALL_RELEASES

docs/changelog.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,69 @@ Logging / Error Messages
105105
* Log Heartbeat thread start / close for debugging (dpkp)
106106

107107

108+
1.4.7 (Sep 30, 2019)
109+
####################
110+
111+
This is a minor release focused on KafkaConsumer performance, Admin Client
112+
improvements, and Client concurrency. The KafkaConsumer iterator implementation
113+
has been greatly simplified so that it just wraps consumer.poll(). The prior
114+
implementation will remain available for a few more releases using the optional
115+
KafkaConsumer config: `legacy_iterator=True` . This is expected to improve
116+
consumer throughput substantially and help reduce heartbeat failures / group
117+
rebalancing.
118+
119+
Client
120+
------
121+
* Send socket data via non-blocking IO with send buffer (dpkp / PR #1912)
122+
* Rely on socket selector to detect completed connection attempts (dpkp / PR #1909)
123+
* Improve connection lock handling; always use context manager (melor,dpkp / PR #1895)
124+
* Reduce client poll timeout when there are no in-flight requests (dpkp / PR #1823)
125+
126+
KafkaConsumer
127+
-------------
128+
* Do not use wakeup when sending fetch requests from consumer (dpkp / PR #1911)
129+
* Wrap `consumer.poll()` for KafkaConsumer iteration (dpkp / PR #1902)
130+
* Allow the coordinator to auto-commit on old brokers (justecorruptio / PR #1832)
131+
* Reduce internal client poll timeout for (legacy) consumer iterator interface (dpkp / PR #1824)
132+
* Use dedicated connection for group coordinator (dpkp / PR #1822)
133+
* Change coordinator lock acquisition order (dpkp / PR #1821)
134+
* Make `partitions_for_topic` a read-through cache (Baisang / PR #1781,#1809)
135+
* Fix consumer hanging indefinitely on topic deletion while rebalancing (commanderdishwasher / PR #1782)
136+
137+
Miscellaneous Bugfixes / Improvements
138+
-------------------------------------
139+
* Fix crc32c avilability on non-intel architectures (ossdev07 / PR #1904)
140+
* Load system default SSL CAs if `ssl_cafile` is not provided (iAnomaly / PR #1883)
141+
* Catch py3 TimeoutError in BrokerConnection send/recv (dpkp / PR #1820)
142+
* Added a function to determine if bootstrap is successfully connected (Wayde2014 / PR #1876)
143+
144+
Admin Client
145+
------------
146+
* Add ACL api support to KafkaAdminClient (ulrikjohansson / PR #1833)
147+
* Add `sasl_kerberos_domain_name` config to KafkaAdminClient (jeffwidman / PR #1852)
148+
* Update `security_protocol` config documentation for KafkaAdminClient (cardy31 / PR #1849)
149+
* Break FindCoordinator into request/response methods in KafkaAdminClient (jeffwidman / PR #1871)
150+
* Break consumer operations into request / response methods in KafkaAdminClient (jeffwidman / PR #1845)
151+
* Parallelize calls to `_send_request_to_node()` in KafkaAdminClient (davidheitman / PR #1807)
152+
153+
Test Infrastructure / Documentation / Maintenance
154+
-------------------------------------------------
155+
* Add Kafka 2.3.0 to test matrix and compatibility docs (dpkp / PR #1915)
156+
* Convert remaining `KafkaConsumer` tests to `pytest` (jeffwidman / PR #1886)
157+
* Bump integration tests to 0.10.2.2 and 0.11.0.3 (jeffwidman / #1890)
158+
* Cleanup handling of `KAFKA_VERSION` env var in tests (jeffwidman / PR #1887)
159+
* Minor test cleanup (jeffwidman / PR #1885)
160+
* Use `socket.SOCK_STREAM` in test assertions (iv-m / PR #1879)
161+
* Sanity test for `consumer.topics()` and `consumer.partitions_for_topic()` (Baisang / PR #1829)
162+
* Cleanup seconds conversion in client poll timeout calculation (jeffwidman / PR #1825)
163+
* Remove unused imports (jeffwidman / PR #1808)
164+
* Cleanup python nits in RangePartitionAssignor (jeffwidman / PR #1805)
165+
* Update links to kafka consumer config docs (jeffwidman)
166+
* Fix minor documentation typos (carsonip / PR #1865)
167+
* Remove unused/weird comment line (jeffwidman / PR #1813)
168+
* Update docs for `api_version_auto_timeout_ms` (jeffwidman / PR #1812)
169+
170+
108171
1.4.6 (Apr 2, 2019)
109172
###################
110173

docs/compatibility.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
Compatibility
22
-------------
33

4-
.. 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
4+
.. 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
55
:target: https://kafka-python.readthedocs.io/compatibility.html
66
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
77
:target: https://pypi.python.org/pypi/kafka-python
88

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

1212
Because the kafka server protocol is backwards compatible, kafka-python is
13-
expected to work with newer broker releases as well (2.0+).
13+
expected to work with newer broker releases as well.
14+
15+
Although kafka-python is tested and expected to work on recent broker versions,
16+
not all features are supported. Specifically, authentication codecs, and
17+
transactional producer/consumer support are not fully implemented. PRs welcome!
1418

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

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
kafka-python
22
############
33

4-
.. 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
4+
.. 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
55
:target: https://kafka-python.readthedocs.io/compatibility.html
66
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
77
:target: https://pypi.python.org/pypi/kafka-python
@@ -136,7 +136,7 @@ for interacting with kafka brokers via the python repl. This is useful for
136136
testing, probing, and general experimentation. The protocol support is
137137
leveraged to enable a :meth:`~kafka.KafkaClient.check_version()`
138138
method that probes a kafka broker and
139-
attempts to identify which version it is running (0.8.0 to 1.1+).
139+
attempts to identify which version it is running (0.8.0 to 2.3+).
140140

141141

142142
Low-level

kafka/admin/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
from kafka.admin.config_resource import ConfigResource, ConfigResourceType
44
from kafka.admin.client import KafkaAdminClient
5+
from kafka.admin.acl_resource import (ACL, ACLFilter, ResourcePattern, ResourcePatternFilter, ACLOperation,
6+
ResourceType, ACLPermissionType, ACLResourcePatternType)
57
from kafka.admin.new_topic import NewTopic
68
from kafka.admin.new_partitions import NewPartitions
79

810
__all__ = [
9-
'ConfigResource', 'ConfigResourceType', 'KafkaAdminClient', 'NewTopic', 'NewPartitions'
11+
'ConfigResource', 'ConfigResourceType', 'KafkaAdminClient', 'NewTopic', 'NewPartitions', 'ACL', 'ACLFilter',
12+
'ResourcePattern', 'ResourcePatternFilter', 'ACLOperation', 'ResourceType', 'ACLPermissionType',
13+
'ACLResourcePatternType'
1014
]

0 commit comments

Comments
 (0)