kafka-python 2.2.4__py2.py3-none-any.whl → 2.2.5__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.
@@ -328,6 +328,9 @@ class RecordAccumulator(object):
328
328
  finally:
329
329
  self._appends_in_progress.decrement()
330
330
 
331
+ def reset_next_batch_expiry_time(self):
332
+ self._next_batch_expiry_time_ms = float('inf')
333
+
331
334
  def maybe_update_next_batch_expiry_time(self, batch):
332
335
  self._next_batch_expiry_time_ms = min(self._next_batch_expiry_time_ms, batch.created * 1000 + self.delivery_timeout_ms)
333
336
 
kafka/producer/sender.py CHANGED
@@ -77,7 +77,7 @@ class Sender(threading.Thread):
77
77
  queue.pop()
78
78
  heapq.heapify(queue)
79
79
 
80
- def _get_expired_inflight_batches(self):
80
+ def _get_expired_inflight_batches(self, now=None):
81
81
  """Get the in-flight batches that has reached delivery timeout."""
82
82
  expired_batches = []
83
83
  to_remove = []
@@ -174,7 +174,7 @@ class Sender(threading.Thread):
174
174
  def _send_producer_data(self, now=None):
175
175
  now = time.time() if now is None else now
176
176
  # get the list of partitions with data ready to send
177
- result = self._accumulator.ready(self._metadata)
177
+ result = self._accumulator.ready(self._metadata, now=now)
178
178
  ready_nodes, next_ready_check_delay, unknown_leaders_exist = result
179
179
 
180
180
  # if there are any partitions whose leaders are not known yet, force
@@ -195,7 +195,7 @@ class Sender(threading.Thread):
195
195
 
196
196
  # create produce requests
197
197
  batches_by_node = self._accumulator.drain(
198
- self._metadata, ready_nodes, self.config['max_request_size'])
198
+ self._metadata, ready_nodes, self.config['max_request_size'], now=now)
199
199
 
200
200
  for batch_list in six.itervalues(batches_by_node):
201
201
  for batch in batch_list:
@@ -209,8 +209,9 @@ class Sender(threading.Thread):
209
209
  for batch in batch_list:
210
210
  self._accumulator.muted.add(batch.topic_partition)
211
211
 
212
- expired_batches = self._accumulator.expired_batches()
213
- expired_batches.extend(self._get_expired_inflight_batches())
212
+ self._accumulator.reset_next_batch_expiry_time()
213
+ expired_batches = self._accumulator.expired_batches(now=now)
214
+ expired_batches.extend(self._get_expired_inflight_batches(now=now))
214
215
 
215
216
  if expired_batches:
216
217
  log.debug("%s: Expired %s batches in accumulator", str(self), len(expired_batches))
kafka/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '2.2.4'
1
+ __version__ = '2.2.5'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kafka-python
3
- Version: 2.2.4
3
+ Version: 2.2.5
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=EnzCJuRkQ6Kh2lIdNwFKvT4PddkZ5bzop4ooGGIhe5g,4366
11
- kafka/version.py,sha256=fHmc2ETGBC5aQYYEdjwwhCQpc1iDi4YoXAxIb24VljI,22
11
+ kafka/version.py,sha256=btKTVVdL8jf2J-q4jm7Otknf3xzOoPGoGVBFald8zts,22
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=RabA8l8Im3iBEXgPVkiofNW6QyeatQHaymBWFZ8Sxkw,78929
@@ -68,8 +68,8 @@ 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=rzsAoB4ser889nRCtILqGqzWI7jREGV9HPngimCWJPE,53211
71
- kafka/producer/record_accumulator.py,sha256=a_mdSATxl-3dVT2rVFh1gTwAv0wUzNbGwVXScwWJ5AE,28072
72
- kafka/producer/sender.py,sha256=2EeA3c7po89F2BLTPjex8-MFKzrCdbXAPvHHDa0SOec,37690
71
+ kafka/producer/record_accumulator.py,sha256=dhJW2vxiEDxsws0xRQ5REIrt3lLNu1g0R7HIMs6pZOY,28172
72
+ kafka/producer/sender.py,sha256=8-TLTw6vQO7AheWSDPI33cQdWMyTDxi1k-pkXuUb9k0,37789
73
73
  kafka/producer/transaction_manager.py,sha256=HNfJNZwNfJtYdftn9SeaDfi7I5MKk0LD3sK64inuPt0,41537
74
74
  kafka/protocol/__init__.py,sha256=T1RBBlTH3zze0Cr1RqemPD4Z1b3IUDRmLOBfZTsPgLs,1184
75
75
  kafka/protocol/abstract.py,sha256=uOnuf6D8OTkL31Tp2QXG3VlzDPHVELGzM_bpSVa-_iw,424
@@ -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.4.dist-info/METADATA,sha256=FZ5evD2mf0bnJwo3vWAnOFNhN8xQMLXs94J8wCNnm3A,9951
124
- kafka_python-2.2.4.dist-info/WHEEL,sha256=KsLc7-ImW3kO10_MVVAJ6KE49o7_KqpEzIMxFX-6COY,109
125
- kafka_python-2.2.4.dist-info/top_level.txt,sha256=IivJz7l5WHdLNDT6RIiVAlhjQzYRwGqBBmKHZ7WjPeM,6
126
- kafka_python-2.2.4.dist-info/RECORD,,
123
+ kafka_python-2.2.5.dist-info/METADATA,sha256=eXJS1RQAidqabXDSgrCAJuZfwtHLYRnXQmsjKjsnI5U,9951
124
+ kafka_python-2.2.5.dist-info/WHEEL,sha256=oSJJyWjO7Z2XSScFQUpXG1HL-N0sFMqqeKVVbZTPkWc,109
125
+ kafka_python-2.2.5.dist-info/top_level.txt,sha256=IivJz7l5WHdLNDT6RIiVAlhjQzYRwGqBBmKHZ7WjPeM,6
126
+ kafka_python-2.2.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.0)
2
+ Generator: setuptools (80.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any