kafka-python 2.2.13__py2.py3-none-any.whl → 2.2.15__py2.py3-none-any.whl

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/consumer/fetcher.py CHANGED
@@ -613,7 +613,8 @@ class Fetcher(six.Iterator):
613
613
  fetchable = self._subscriptions.fetchable_partitions()
614
614
  # do not fetch a partition if we have a pending fetch response to process
615
615
  # use copy.copy to avoid runtimeerror on mutation from different thread
616
- discard = {fetch.topic_partition for fetch in self._completed_fetches.copy()}
616
+ # TODO: switch to deque.copy() with py3
617
+ discard = {fetch.topic_partition for fetch in copy.copy(self._completed_fetches)}
617
618
  current = self._next_partition_records
618
619
  if current:
619
620
  discard.add(current.topic_partition)
kafka/consumer/group.py CHANGED
@@ -123,7 +123,7 @@ class KafkaConsumer(six.Iterator):
123
123
  be disabled in cases seeking extreme performance. Default: True
124
124
  isolation_level (str): Configure KIP-98 transactional consumer by
125
125
  setting to 'read_committed'. This will cause the consumer to
126
- skip records from aborted tranactions. Default: 'read_uncommitted'
126
+ skip records from aborted transactions. Default: 'read_uncommitted'
127
127
  allow_auto_create_topics (bool): Enable/disable auto topic creation
128
128
  on metadata request. Only available with api_version >= (0, 11).
129
129
  Default: True
kafka/coordinator/base.py CHANGED
@@ -857,14 +857,12 @@ class BaseCoordinator(object):
857
857
  self._heartbeat_thread.disable()
858
858
 
859
859
  def _close_heartbeat_thread(self, timeout_ms=None):
860
- with self._lock:
861
- if self._heartbeat_thread is not None:
862
- heartbeat_log.info('Stopping heartbeat thread')
863
- try:
864
- self._heartbeat_thread.close(timeout_ms=timeout_ms)
865
- except ReferenceError:
866
- pass
867
- self._heartbeat_thread = None
860
+ if self._heartbeat_thread is not None:
861
+ try:
862
+ self._heartbeat_thread.close(timeout_ms=timeout_ms)
863
+ except ReferenceError:
864
+ pass
865
+ self._heartbeat_thread = None
868
866
 
869
867
  def __del__(self):
870
868
  try:
@@ -1047,17 +1045,20 @@ class HeartbeatThread(threading.Thread):
1047
1045
  self.enabled = False
1048
1046
 
1049
1047
  def close(self, timeout_ms=None):
1050
- if self.closed:
1051
- return
1052
- self.closed = True
1048
+ with self.coordinator._lock:
1049
+ if self.closed:
1050
+ return
1053
1051
 
1054
- # Generally this should not happen - close() is triggered
1055
- # by the coordinator. But in some cases GC may close the coordinator
1056
- # from within the heartbeat thread.
1057
- if threading.current_thread() == self:
1058
- return
1052
+ heartbeat_log.info('Stopping heartbeat thread')
1053
+ self.closed = True
1059
1054
 
1060
- with self.coordinator._lock:
1055
+ # Generally this should not happen - close() is triggered
1056
+ # by the coordinator. But in some cases GC may close the coordinator
1057
+ # from within the heartbeat thread.
1058
+ if threading.current_thread() == self:
1059
+ return
1060
+
1061
+ # Notify coordinator lock to wake thread from sleep/lock.wait
1061
1062
  self.coordinator._lock.notify()
1062
1063
 
1063
1064
  if self.is_alive():
@@ -430,7 +430,7 @@ class RecordAccumulator(object):
430
430
  expired = bool(waited_time >= time_to_wait)
431
431
 
432
432
  sendable = (full or expired or self._closed or
433
- self._flush_in_progress())
433
+ self.flush_in_progress())
434
434
 
435
435
  if sendable and not backing_off:
436
436
  ready_nodes.add(leader)
@@ -563,7 +563,7 @@ class RecordAccumulator(object):
563
563
  """Deallocate the record batch."""
564
564
  self._incomplete.remove(batch)
565
565
 
566
- def _flush_in_progress(self):
566
+ def flush_in_progress(self):
567
567
  """Are there any threads currently waiting on a flush?"""
568
568
  return self._flushes_in_progress.get() > 0
569
569
 
@@ -553,11 +553,11 @@ class TxnRequestHandler(object):
553
553
  return self.transaction_manager.producer_id_and_epoch.epoch
554
554
 
555
555
  def fatal_error(self, exc):
556
- self.transaction_manager._transition_to_fatal_error(exc)
556
+ self.transaction_manager.transition_to_fatal_error(exc)
557
557
  self._result.done(error=exc)
558
558
 
559
559
  def abortable_error(self, exc):
560
- self.transaction_manager._transition_to_abortable_error(exc)
560
+ self.transaction_manager.transition_to_abortable_error(exc)
561
561
  self._result.done(error=exc)
562
562
 
563
563
  def fail(self, exc):
kafka/sasl/gssapi.py CHANGED
@@ -68,10 +68,10 @@ class SaslMechanismGSSAPI(SaslMechanism):
68
68
  # simply set QoP to 'auth' only (first octet). We reuse the max message size proposed
69
69
  # by the server
70
70
  client_flags = self.SASL_QOP_AUTH
71
- server_flags = msg[0]
71
+ server_flags = struct.Struct('>b').unpack(msg[0:1])[0]
72
72
  message_parts = [
73
73
  struct.Struct('>b').pack(client_flags & server_flags),
74
- msg[1:],
74
+ msg[1:], # always agree to max message size from server
75
75
  self.auth_id.encode('utf-8'),
76
76
  ]
77
77
  # add authorization identity to the response, and GSS-wrap
kafka/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '2.2.13'
1
+ __version__ = '2.2.15'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kafka-python
3
- Version: 2.2.13
3
+ Version: 2.2.15
4
4
  Summary: Pure Python client for Apache Kafka
5
5
  Author-email: Dana Powers <dana.powers@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/dpkp/kafka-python
@@ -8,7 +8,7 @@ kafka/future.py,sha256=ZQStbfUYIPJRrgMfAWxxjrIRVxsw4WCtSR0J0bkyGno,2847
8
8
  kafka/socks5_wrapper.py,sha256=6woOaCTJXJ5e89_zdyW5BjOpyE4rCbYFH-kd-FeuPuk,9827
9
9
  kafka/structs.py,sha256=SJGzmLdV21jZyQ7247k0WFy16UiusgTHK3I-e4qzI-E,3058
10
10
  kafka/util.py,sha256=WGqI5yT1yWGgHqSuRF9Fi8ejpiB53SurMy7ABkYxJ2g,4584
11
- kafka/version.py,sha256=S3fvQ15-qQvC8uRl-8WEv_OdN6XLbs5Y44t3ZDfXWII,23
11
+ kafka/version.py,sha256=Vh0q00JWD6pn7UpRKd065A7-8g7Bv7yYCxnqmZMfsFY,23
12
12
  kafka/admin/__init__.py,sha256=S_XxqyyV480_yXhttK79XZqNAmZyXRjspd3SoqYykE8,720
13
13
  kafka/admin/acl_resource.py,sha256=ak_dUsSni4SyP0ORbSKenZpwTy0Ykxq3FSt_9XgLR8k,8265
14
14
  kafka/admin/client.py,sha256=94UpHTsgzvhOoB6_1QLeKxvZKlStKfI96xuWyaY9_Sc,78814
@@ -23,11 +23,11 @@ kafka/benchmarks/record_batch_compose.py,sha256=CnUreNg1lUT0Qx9enmSr-THmBl9PjVMf
23
23
  kafka/benchmarks/record_batch_read.py,sha256=vlFaWU2YWI379n_2M8qieb_S2uHUWKV0NquEYy5b-Ho,2184
24
24
  kafka/benchmarks/varint_speed.py,sha256=s4CuvKgDZL-_zna5E3vM8RgHjhXuW6pcaO1z1WYZ_0Y,12585
25
25
  kafka/consumer/__init__.py,sha256=NDdvtyuJgFyQZahqL9i5sYXGP6rOMIXWwHQEaZ1fCcs,122
26
- kafka/consumer/fetcher.py,sha256=OvKKC8lZCWJZaeT6EfHwr4-7_noN82yWPxcQB8v5l4Q,69132
27
- kafka/consumer/group.py,sha256=oieWNHM1NWiOZT8pasOLfFJAbmJEXJ4h7PgUtklxo_Q,58944
26
+ kafka/consumer/fetcher.py,sha256=RlQLut54c5nOMl21neTJA2tmdsxIIPIX2Idu5Q-dYKY,69184
27
+ kafka/consumer/group.py,sha256=1_4qES7x3XyAHjVbFZ_E0ilAoueyaeHiGpNgggYLGiQ,58945
28
28
  kafka/consumer/subscription_state.py,sha256=bK-YTVbOzhy8OB206QAfXVuo7zPA9YqYXnrRRST369c,24289
29
29
  kafka/coordinator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- kafka/coordinator/base.py,sha256=NmHXyqoJZVXL2KhahXLCOH1zVx9gyTdhrt-_unxIAaE,54365
30
+ kafka/coordinator/base.py,sha256=hXfwtDkrHXHiNqjshCOa19js_2Y6ibLsdzDvJKGmcKc,54419
31
31
  kafka/coordinator/consumer.py,sha256=le4bGbHfrDK4pperYXekPKzuZW576uXL324IOwS4Kmw,46348
32
32
  kafka/coordinator/heartbeat.py,sha256=LeJJlwz1oUEOfEMIFT-R7ZOHBQ-b-luVKwmKyWxLfDo,3242
33
33
  kafka/coordinator/protocol.py,sha256=wTaIOnUVbj0CKXZ82FktZo-zMRvOCk3hdQAoHJ62e3I,1041
@@ -68,9 +68,9 @@ kafka/partitioner/default.py,sha256=tW-RC1PWIPRDEbeEAaPTLn-00oiZnXoVouEk9AnYE4w,
68
68
  kafka/producer/__init__.py,sha256=i3Wxih0NHjmqCkRNE54ial8fBp9siqabUE6ZGyL6oX8,122
69
69
  kafka/producer/future.py,sha256=UC3-g9QlgVFmbitrtMXVpeP0Pbvr7xl2kcw6bAehKG8,2983
70
70
  kafka/producer/kafka.py,sha256=oGO-UxoVZEFdBLOQ7zEqeDJWXMxKyUdNV-pCRU3jZmg,53302
71
- kafka/producer/record_accumulator.py,sha256=dhJW2vxiEDxsws0xRQ5REIrt3lLNu1g0R7HIMs6pZOY,28172
71
+ kafka/producer/record_accumulator.py,sha256=xNkHOCmganxDfa3W_Y3iBLT4RaAOZi0Lix-mUzsp2aQ,28170
72
72
  kafka/producer/sender.py,sha256=8-TLTw6vQO7AheWSDPI33cQdWMyTDxi1k-pkXuUb9k0,37789
73
- kafka/producer/transaction_manager.py,sha256=HNfJNZwNfJtYdftn9SeaDfi7I5MKk0LD3sK64inuPt0,41537
73
+ kafka/producer/transaction_manager.py,sha256=q3e9Lc9o-ofWvjT9FbHdTQH08XQBeRtoQEcQHGcnp7g,41535
74
74
  kafka/protocol/__init__.py,sha256=T1RBBlTH3zze0Cr1RqemPD4Z1b3IUDRmLOBfZTsPgLs,1184
75
75
  kafka/protocol/abstract.py,sha256=uOnuf6D8OTkL31Tp2QXG3VlzDPHVELGzM_bpSVa-_iw,424
76
76
  kafka/protocol/add_offsets_to_txn.py,sha256=Hya7vg6yqsV9XGLKWi8rES_VuN47-H4fdycg6mx8GLY,1486
@@ -107,7 +107,7 @@ kafka/record/memory_records.py,sha256=b7RFxvaQ93drXSk3o3_YB3FQlVoESoBlGj3Z5PD25n
107
107
  kafka/record/util.py,sha256=LDajBWdYVetmXts_t9Q76CxEx7njgC9LnjMgz9yPEMM,3556
108
108
  kafka/sasl/__init__.py,sha256=wUUGIKRe52J6Qekj7hSypg44vWTrkYsEdVafQC7cX5s,1106
109
109
  kafka/sasl/abc.py,sha256=R0BZOk3AYEGyehiGbbg-LMRvFAlWZsh0fBiESgUpBYw,657
110
- kafka/sasl/gssapi.py,sha256=Q8bZ5J2Ap8aJc-P0EFIPeQSgsUkOxO8a_FJs5eZcZGA,4625
110
+ kafka/sasl/gssapi.py,sha256=pwLxXqcmJJxkuFQUoEfX5PWgZxr-8TziuRCg9K7fO3E,4705
111
111
  kafka/sasl/msk.py,sha256=FCv0uUTQKjvR2gIGyiv-dlwIvkpvEtaHvhqhXtC2q8w,8101
112
112
  kafka/sasl/oauth.py,sha256=dh87tVi-dlS5lIzgYsC4m7IXUhlLdejaMb9Ua6oYaB0,3425
113
113
  kafka/sasl/plain.py,sha256=PMfoWT856wx6nF_LhpfPKEnD7BRNx5l6rDhAqxBnMWU,1317
@@ -120,7 +120,7 @@ kafka/vendor/enum34.py,sha256=-u-lxAiJMt6ru4Do7NUDY9OpeWkYJMksb2xengJawFE,31204
120
120
  kafka/vendor/selectors34.py,sha256=gxejLO4eXf8mRSGXaQiknPig3GdX1rtsZiYOQJVuAy8,20594
121
121
  kafka/vendor/six.py,sha256=lLBa9_HrANP5BMZ7twEzg1M3wofwPmXyptuWmHX0brY,34826
122
122
  kafka/vendor/socketpair.py,sha256=Fi3PoY1Okkppab720wFk1BhHXyjcw7hi5DwhqrYZH2Y,2737
123
- kafka_python-2.2.13.dist-info/METADATA,sha256=SKLIFNXQV0p6OyXWXqGb_VE1LaZou272d1z-3leFkYA,9952
124
- kafka_python-2.2.13.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
125
- kafka_python-2.2.13.dist-info/top_level.txt,sha256=IivJz7l5WHdLNDT6RIiVAlhjQzYRwGqBBmKHZ7WjPeM,6
126
- kafka_python-2.2.13.dist-info/RECORD,,
123
+ kafka_python-2.2.15.dist-info/METADATA,sha256=K9jQXj1ujRv2RCbdfjE07NblzS8mIlVycU1q_bMOtUc,9952
124
+ kafka_python-2.2.15.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
125
+ kafka_python-2.2.15.dist-info/top_level.txt,sha256=IivJz7l5WHdLNDT6RIiVAlhjQzYRwGqBBmKHZ7WjPeM,6
126
+ kafka_python-2.2.15.dist-info/RECORD,,