kafka-python 2.2.19__tar.gz → 2.2.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kafka_python-2.2.19 → kafka_python-2.2.20}/CHANGES.md +8 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/PKG-INFO +2 -2
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/admin/client.py +4 -2
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/client_async.py +4 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/conn.py +16 -8
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/consumer/group.py +4 -2
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/errors.py +4 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/future.py +8 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/producer/kafka.py +4 -2
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/parser.py +9 -1
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/sasl/scram.py +6 -1
- kafka_python-2.2.20/kafka/version.py +1 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka_python.egg-info/PKG-INFO +2 -2
- kafka_python-2.2.19/kafka/version.py +0 -1
- {kafka_python-2.2.19 → kafka_python-2.2.20}/AUTHORS.md +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/LICENSE +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/MANIFEST.in +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/README.rst +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/admin/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/admin/acl_resource.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/admin/config_resource.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/admin/new_partitions.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/admin/new_topic.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/benchmarks/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/benchmarks/consumer_performance.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/benchmarks/load_example.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/benchmarks/producer_performance.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/benchmarks/record_batch_compose.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/benchmarks/record_batch_read.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/benchmarks/varint_speed.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/cluster.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/codec.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/consumer/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/consumer/fetcher.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/consumer/subscription_state.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/abstract.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/range.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/roundrobin.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/sticky/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/sticky/partition_movements.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/sticky/sorted_set.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/sticky/sticky_assignor.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/base.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/consumer.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/heartbeat.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/protocol.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/compound_stat.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/dict_reporter.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/kafka_metric.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/measurable.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/measurable_stat.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/metric_config.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/metric_name.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/metrics.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/metrics_reporter.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/quota.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stat.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/avg.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/count.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/histogram.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/max_stat.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/min_stat.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/percentile.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/percentiles.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/rate.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/sampled_stat.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/sensor.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/metrics/stats/total.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/partitioner/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/partitioner/default.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/producer/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/producer/future.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/producer/record_accumulator.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/producer/sender.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/producer/transaction_manager.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/abstract.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/add_offsets_to_txn.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/add_partitions_to_txn.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/admin.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/api.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/api_versions.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/broker_api_versions.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/commit.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/end_txn.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/fetch.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/find_coordinator.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/frame.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/group.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/init_producer_id.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/list_offsets.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/message.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/metadata.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/offset_for_leader_epoch.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/pickle.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/produce.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/sasl_authenticate.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/sasl_handshake.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/struct.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/txn_offset_commit.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/protocol/types.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/record/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/record/_crc32c.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/record/abc.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/record/default_records.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/record/legacy_records.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/record/memory_records.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/record/util.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/sasl/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/sasl/abc.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/sasl/gssapi.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/sasl/msk.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/sasl/oauth.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/sasl/plain.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/sasl/sspi.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/serializer/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/serializer/abstract.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/socks5_wrapper.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/structs.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/util.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/vendor/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/vendor/enum34.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/vendor/selectors34.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/vendor/six.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/vendor/socketpair.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka_python.egg-info/SOURCES.txt +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka_python.egg-info/dependency_links.txt +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka_python.egg-info/requires.txt +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/kafka_python.egg-info/top_level.txt +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/pyproject.toml +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/setup.cfg +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/setup.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/integration/__init__.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/integration/conftest.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/integration/fixtures.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/integration/test_admin_integration.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/integration/test_consumer_group.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/integration/test_consumer_integration.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/integration/test_producer_integration.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/integration/test_sasl_integration.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_acl_comparisons.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_admin.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_api_object_implementation.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_assignors.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_client_async.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_cluster.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_codec.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_conn.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_consumer.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_coordinator.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_fetcher.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_metrics.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_object_conversion.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_package.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_partition_movements.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_partitioner.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_producer.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_record_accumulator.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_sender.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_subscription_state.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/test_util.py +0 -0
- {kafka_python-2.2.19 → kafka_python-2.2.20}/test/testutil.py +0 -0
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# 2.2.20 (Jun 3, 2026)
|
|
2
|
+
|
|
3
|
+
Fixes
|
|
4
|
+
* kafka.conn: Improve error handling for sasl authenticate mechanisms
|
|
5
|
+
* kafka.net: Validate SASL/SCRAM iterations (#3026)
|
|
6
|
+
* KafkaProtocol: validate network frame size (backport of #3019)
|
|
7
|
+
* Clear `_callbacks`/`_errbacks` list when future `is_done` to avoid reference cycles (#2891)
|
|
8
|
+
|
|
1
9
|
# 2.2.19 (Apr 9, 2026)
|
|
2
10
|
|
|
3
11
|
Fixes
|
|
@@ -87,6 +87,9 @@ class KafkaAdminClient(object):
|
|
|
87
87
|
max_in_flight_requests_per_connection (int): Requests are pipelined
|
|
88
88
|
to kafka brokers up to this number of maximum requests per
|
|
89
89
|
broker connection. Default: 5.
|
|
90
|
+
receive_message_max_bytes (int): Maximum allowed network frame size.
|
|
91
|
+
Used to avoid OOM when decoding malformed network message header.
|
|
92
|
+
Default: 1000000.
|
|
90
93
|
receive_buffer_bytes (int): The size of the TCP receive buffer
|
|
91
94
|
(SO_RCVBUF) to use when reading data. Default: None (relies on
|
|
92
95
|
system defaults). Java client defaults to 32768.
|
|
@@ -163,11 +166,10 @@ class KafkaAdminClient(object):
|
|
|
163
166
|
'reconnect_backoff_ms': 50,
|
|
164
167
|
'reconnect_backoff_max_ms': 30000,
|
|
165
168
|
'max_in_flight_requests_per_connection': 5,
|
|
169
|
+
'receive_message_max_bytes': 1000000,
|
|
166
170
|
'receive_buffer_bytes': None,
|
|
167
171
|
'send_buffer_bytes': None,
|
|
168
172
|
'socket_options': [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)],
|
|
169
|
-
'sock_chunk_bytes': 4096, # undocumented experimental option
|
|
170
|
-
'sock_chunk_buffer_count': 1000, # undocumented experimental option
|
|
171
173
|
'retry_backoff_ms': 100,
|
|
172
174
|
'metadata_max_age_ms': 300000,
|
|
173
175
|
'security_protocol': 'PLAINTEXT',
|
|
@@ -89,6 +89,9 @@ class KafkaClient(object):
|
|
|
89
89
|
max_in_flight_requests_per_connection (int): Requests are pipelined
|
|
90
90
|
to kafka brokers up to this number of maximum requests per
|
|
91
91
|
broker connection. Default: 5.
|
|
92
|
+
receive_message_max_bytes (int): Maximum allowed network frame size.
|
|
93
|
+
Used to avoid OOM when decoding malformed network message header.
|
|
94
|
+
Default: 1000000.
|
|
92
95
|
receive_buffer_bytes (int): The size of the TCP receive buffer
|
|
93
96
|
(SO_RCVBUF) to use when reading data. Default: None (relies on
|
|
94
97
|
system defaults). Java client defaults to 32768.
|
|
@@ -186,6 +189,7 @@ class KafkaClient(object):
|
|
|
186
189
|
'reconnect_backoff_ms': 50,
|
|
187
190
|
'reconnect_backoff_max_ms': 30000,
|
|
188
191
|
'max_in_flight_requests_per_connection': 5,
|
|
192
|
+
'receive_message_max_bytes': 1000000,
|
|
189
193
|
'receive_buffer_bytes': None,
|
|
190
194
|
'send_buffer_bytes': None,
|
|
191
195
|
'socket_options': [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)],
|
|
@@ -122,6 +122,9 @@ class BrokerConnection(object):
|
|
|
122
122
|
max_in_flight_requests_per_connection (int): Requests are pipelined
|
|
123
123
|
to kafka brokers up to this number of maximum requests per
|
|
124
124
|
broker connection. Default: 5.
|
|
125
|
+
receive_message_max_bytes (int): Maximum allowed network frame size.
|
|
126
|
+
Used to avoid OOM when decoding malformed network message header.
|
|
127
|
+
Default: 1000000.
|
|
125
128
|
receive_buffer_bytes (int): The size of the TCP receive buffer
|
|
126
129
|
(SO_RCVBUF) to use when reading data. Default: None (relies on
|
|
127
130
|
system defaults). Java client defaults to 32768.
|
|
@@ -202,6 +205,7 @@ class BrokerConnection(object):
|
|
|
202
205
|
'reconnect_backoff_ms': 50,
|
|
203
206
|
'reconnect_backoff_max_ms': 30000,
|
|
204
207
|
'max_in_flight_requests_per_connection': 5,
|
|
208
|
+
'receive_message_max_bytes': 1000000,
|
|
205
209
|
'receive_buffer_bytes': None,
|
|
206
210
|
'send_buffer_bytes': None,
|
|
207
211
|
'socket_options': [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)],
|
|
@@ -292,7 +296,8 @@ class BrokerConnection(object):
|
|
|
292
296
|
|
|
293
297
|
self._protocol = KafkaProtocol(
|
|
294
298
|
client_id=self.config['client_id'],
|
|
295
|
-
api_version=self.config['api_version']
|
|
299
|
+
api_version=self.config['api_version'],
|
|
300
|
+
max_frame_size=self.config['receive_message_max_bytes'])
|
|
296
301
|
self.state = ConnectionStates.DISCONNECTED
|
|
297
302
|
self._reset_reconnect_backoff()
|
|
298
303
|
self._sock = None
|
|
@@ -695,9 +700,12 @@ class BrokerConnection(object):
|
|
|
695
700
|
'Kafka broker does not support %s sasl mechanism. Enabled mechanisms are: %s'
|
|
696
701
|
% (self.config['sasl_mechanism'], response.enabled_mechanisms)))
|
|
697
702
|
else:
|
|
698
|
-
|
|
703
|
+
try:
|
|
704
|
+
ret = self._sasl_authenticate()
|
|
705
|
+
future.success(ret)
|
|
706
|
+
except Exception as exc:
|
|
707
|
+
future.failure(exc)
|
|
699
708
|
|
|
700
|
-
assert future.is_done, 'SASL future not complete after mechanism processing!'
|
|
701
709
|
if future.failed():
|
|
702
710
|
self.close(error=future.exception)
|
|
703
711
|
else:
|
|
@@ -809,24 +817,24 @@ class BrokerConnection(object):
|
|
|
809
817
|
log.debug('%s: Received %d raw sasl auth bytes from server', self, nbytes)
|
|
810
818
|
return data[4:]
|
|
811
819
|
|
|
812
|
-
def _sasl_authenticate(self
|
|
820
|
+
def _sasl_authenticate(self):
|
|
813
821
|
while not self._sasl_mechanism.is_done():
|
|
814
822
|
send_token = self._sasl_mechanism.auth_bytes()
|
|
815
823
|
self._send_sasl_authenticate(send_token)
|
|
816
824
|
if not self._can_send_recv():
|
|
817
|
-
|
|
825
|
+
raise Errors.KafkaConnectionError("%s: Connection failure during Sasl Authenticate" % self)
|
|
818
826
|
|
|
819
827
|
recv_token = self._recv_sasl_authenticate()
|
|
820
828
|
if recv_token is None:
|
|
821
|
-
|
|
829
|
+
raise Errors.KafkaConnectionError("%s: Connection failure during Sasl Authenticate" % self)
|
|
822
830
|
else:
|
|
823
831
|
self._sasl_mechanism.receive(recv_token)
|
|
824
832
|
|
|
825
833
|
if self._sasl_mechanism.is_authenticated():
|
|
826
834
|
log.info('%s: %s', self, self._sasl_mechanism.auth_details())
|
|
827
|
-
return
|
|
835
|
+
return True
|
|
828
836
|
else:
|
|
829
|
-
|
|
837
|
+
raise Errors.SaslAuthenticationFailedError('Failed to authenticate via SASL %s' % self.config['sasl_mechanism'])
|
|
830
838
|
|
|
831
839
|
def blacked_out(self):
|
|
832
840
|
"""
|
|
@@ -163,6 +163,9 @@ class KafkaConsumer(six.Iterator):
|
|
|
163
163
|
should be set no higher than 1/3 of that value. It can be
|
|
164
164
|
adjusted even lower to control the expected time for normal
|
|
165
165
|
rebalances. Default: 3000
|
|
166
|
+
receive_message_max_bytes (int): Maximum allowed network frame size.
|
|
167
|
+
Used to avoid OOM when decoding malformed network message header.
|
|
168
|
+
Default: 1000000.
|
|
166
169
|
receive_buffer_bytes (int): The size of the TCP receive buffer
|
|
167
170
|
(SO_RCVBUF) to use when reading data. Default: None (relies on
|
|
168
171
|
system defaults). The java client defaults to 32768.
|
|
@@ -303,9 +306,8 @@ class KafkaConsumer(six.Iterator):
|
|
|
303
306
|
'heartbeat_interval_ms': 3000,
|
|
304
307
|
'receive_buffer_bytes': None,
|
|
305
308
|
'send_buffer_bytes': None,
|
|
309
|
+
'receive_message_max_bytes': 1000000,
|
|
306
310
|
'socket_options': [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)],
|
|
307
|
-
'sock_chunk_bytes': 4096, # undocumented experimental option
|
|
308
|
-
'sock_chunk_buffer_count': 1000, # undocumented experimental option
|
|
309
311
|
'consumer_timeout_ms': float('inf'),
|
|
310
312
|
'security_protocol': 'PLAINTEXT',
|
|
311
313
|
'ssl_context': None,
|
|
@@ -37,6 +37,10 @@ class Future(object):
|
|
|
37
37
|
self.is_done = True
|
|
38
38
|
if self._callbacks:
|
|
39
39
|
self._call_backs('callback', self._callbacks, self.value)
|
|
40
|
+
# Clearing the lists releases any reference cycle held via stored
|
|
41
|
+
# bound methods (e.g. FutureProduceResult<->FutureRecordMetadata).
|
|
42
|
+
self._callbacks = None
|
|
43
|
+
self._errbacks = None
|
|
40
44
|
return self
|
|
41
45
|
|
|
42
46
|
def failure(self, e):
|
|
@@ -48,6 +52,10 @@ class Future(object):
|
|
|
48
52
|
self.exception = exception
|
|
49
53
|
self.is_done = True
|
|
50
54
|
self._call_backs('errback', self._errbacks, self.exception)
|
|
55
|
+
# Clearing the lists releases any reference cycle held via stored
|
|
56
|
+
# bound methods (e.g. FutureProduceResult<->FutureRecordMetadata).
|
|
57
|
+
self._callbacks = None
|
|
58
|
+
self._errbacks = None
|
|
51
59
|
return self
|
|
52
60
|
|
|
53
61
|
def add_callback(self, f, *args, **kwargs):
|
|
@@ -261,6 +261,9 @@ class KafkaProducer(object):
|
|
|
261
261
|
errors. Default: 100.
|
|
262
262
|
request_timeout_ms (int): Client request timeout in milliseconds.
|
|
263
263
|
Default: 30000.
|
|
264
|
+
receive_message_max_bytes (int): Maximum allowed network frame size.
|
|
265
|
+
Used to avoid OOM when decoding malformed network message header.
|
|
266
|
+
Default: 1000000.
|
|
264
267
|
receive_buffer_bytes (int): The size of the TCP receive buffer
|
|
265
268
|
(SO_RCVBUF) to use when reading data. Default: None (relies on
|
|
266
269
|
system defaults). Java client defaults to 32768.
|
|
@@ -392,11 +395,10 @@ class KafkaProducer(object):
|
|
|
392
395
|
'metadata_max_age_ms': 300000,
|
|
393
396
|
'retry_backoff_ms': 100,
|
|
394
397
|
'request_timeout_ms': 30000,
|
|
398
|
+
'receive_message_max_bytes': 1000000,
|
|
395
399
|
'receive_buffer_bytes': None,
|
|
396
400
|
'send_buffer_bytes': None,
|
|
397
401
|
'socket_options': [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)],
|
|
398
|
-
'sock_chunk_bytes': 4096, # undocumented experimental option
|
|
399
|
-
'sock_chunk_buffer_count': 1000, # undocumented experimental option
|
|
400
402
|
'reconnect_backoff_ms': 50,
|
|
401
403
|
'reconnect_backoff_max_ms': 30000,
|
|
402
404
|
'max_in_flight_requests_per_connection': 5,
|
|
@@ -23,12 +23,15 @@ class KafkaProtocol(object):
|
|
|
23
23
|
api_version (tuple): Optional tuple to specify api_version to use.
|
|
24
24
|
Currently only used to check for 0.8.2 protocol quirks, but
|
|
25
25
|
may be used for more in the future.
|
|
26
|
+
max_frame_size (int): Maximum allowed message frame size.
|
|
27
|
+
Default: 100000000 (100MB).
|
|
26
28
|
"""
|
|
27
|
-
def __init__(self, client_id=None, api_version=None):
|
|
29
|
+
def __init__(self, client_id=None, api_version=None, max_frame_size=100000000):
|
|
28
30
|
if client_id is None:
|
|
29
31
|
client_id = self._gen_client_id()
|
|
30
32
|
self._client_id = client_id
|
|
31
33
|
self._api_version = api_version
|
|
34
|
+
self._max_frame_size = max_frame_size
|
|
32
35
|
self._correlation_id = 0
|
|
33
36
|
self._header = KafkaBytes(4)
|
|
34
37
|
self._rbuffer = None
|
|
@@ -105,6 +108,7 @@ class KafkaProtocol(object):
|
|
|
105
108
|
if self._header.tell() == 4:
|
|
106
109
|
self._header.seek(0)
|
|
107
110
|
nbytes = Int32.decode(self._header)
|
|
111
|
+
self._validate_frame_size(nbytes)
|
|
108
112
|
# reset buffer and switch state to receiving payload bytes
|
|
109
113
|
self._rbuffer = KafkaBytes(nbytes)
|
|
110
114
|
self._receiving = True
|
|
@@ -132,6 +136,10 @@ class KafkaProtocol(object):
|
|
|
132
136
|
self._reset_buffer()
|
|
133
137
|
return responses
|
|
134
138
|
|
|
139
|
+
def _validate_frame_size(self, nbytes):
|
|
140
|
+
if nbytes < 0 or nbytes > self._max_frame_size:
|
|
141
|
+
raise Errors.InvalidReceiveError('Invalid frame length: %d' % nbytes)
|
|
142
|
+
|
|
135
143
|
def _process_response(self, read_buffer):
|
|
136
144
|
if not self.in_flight_requests:
|
|
137
145
|
raise Errors.CorrelationIdError('No in-flight-request found for server response')
|
|
@@ -106,7 +106,12 @@ class ScramClient:
|
|
|
106
106
|
self.auth_message += b',c=biws,r=' + self.nonce
|
|
107
107
|
|
|
108
108
|
salt = base64.b64decode(params['s'].encode('utf-8'))
|
|
109
|
-
|
|
109
|
+
try:
|
|
110
|
+
iterations = int(params['i'])
|
|
111
|
+
if iterations > 1000000:
|
|
112
|
+
raise ValueError('too many iterations')
|
|
113
|
+
except (TypeError, ValueError):
|
|
114
|
+
raise ValueError('Invalid value (not integer or too large) for Iteration count in server-first-message')
|
|
110
115
|
self.create_salted_password(salt, iterations)
|
|
111
116
|
|
|
112
117
|
self.client_key = self.hmac(self.salted_password, b'Client Key')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.2.20'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.2.19'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/sticky/sorted_set.py
RENAMED
|
File without changes
|
{kafka_python-2.2.19 → kafka_python-2.2.20}/kafka/coordinator/assignors/sticky/sticky_assignor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|