kafka-python 2.2.13__py2.py3-none-any.whl → 2.2.14__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/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():
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.14'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kafka-python
3
- Version: 2.2.13
3
+ Version: 2.2.14
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=PR6uSCwslT9zrWgpYBe2K-rcBonsAlnUCAlbjmvi0Yc,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
26
+ kafka/consumer/fetcher.py,sha256=RlQLut54c5nOMl21neTJA2tmdsxIIPIX2Idu5Q-dYKY,69184
27
27
  kafka/consumer/group.py,sha256=oieWNHM1NWiOZT8pasOLfFJAbmJEXJ4h7PgUtklxo_Q,58944
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
@@ -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.14.dist-info/METADATA,sha256=ShmA7Vjv6JzZqT0ktCUjlSoO_EqgOFIWdpsgj2awOoA,9952
124
+ kafka_python-2.2.14.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
125
+ kafka_python-2.2.14.dist-info/top_level.txt,sha256=IivJz7l5WHdLNDT6RIiVAlhjQzYRwGqBBmKHZ7WjPeM,6
126
+ kafka_python-2.2.14.dist-info/RECORD,,