sentry-arroyo 2.19.7__py3-none-any.whl → 2.19.9__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.
arroyo/dlq.py CHANGED
@@ -44,12 +44,18 @@ class InvalidMessage(Exception):
44
44
  """
45
45
 
46
46
  def __init__(
47
- self, partition: Partition, offset: int, needs_commit: bool = True, reason: Optional[str] = None,
47
+ self,
48
+ partition: Partition,
49
+ offset: int,
50
+ needs_commit: bool = True,
51
+ reason: Optional[str] = None,
52
+ log_exception: bool = True
48
53
  ) -> None:
49
54
  self.partition = partition
50
55
  self.offset = offset
51
56
  self.needs_commit = needs_commit
52
57
  self.reason = reason
58
+ self.log_exception = log_exception
53
59
 
54
60
  @classmethod
55
61
  def from_value(cls, value: BrokerValue[Any]) -> InvalidMessage:
@@ -365,7 +365,8 @@ class StreamProcessor(Generic[TStrategyPayload]):
365
365
  ):
366
366
  self.__message = None
367
367
 
368
- logger.exception(exc)
368
+ if exc.log_exception:
369
+ logger.exception(exc)
369
370
  self.__metrics_buffer.incr_counter("arroyo.consumer.invalid_message.count", 1)
370
371
  if self.__dlq_policy:
371
372
  start_dlq = time.time()
@@ -446,10 +447,27 @@ class StreamProcessor(Generic[TStrategyPayload]):
446
447
  self.__is_paused = True
447
448
 
448
449
  elif self.__is_paused:
449
- # A paused consumer should still poll periodically to avoid it's partitions
450
- # getting revoked by the broker after reaching the max.poll.interval.ms
451
- # Polling a paused consumer should never yield a message.
452
- assert self.__consumer.poll(0.1) is None
450
+ paused_partitions = set(self.__consumer.paused())
451
+ unpaused_partitions = (
452
+ set(self.__consumer.tell()) - paused_partitions
453
+ )
454
+ if unpaused_partitions:
455
+ logger.warning(
456
+ "Processor in paused state while consumer is partially unpaused: %s, paused: %s",
457
+ unpaused_partitions,
458
+ paused_partitions,
459
+ )
460
+ self.__is_paused = False
461
+ # unpause paused partitions... just in case a subset is paused
462
+ self.__metrics_buffer.incr_counter(
463
+ "arroyo.consumer.resume", 1
464
+ )
465
+ self.__consumer.resume([*paused_partitions])
466
+ else:
467
+ # A paused consumer should still poll periodically to avoid it's partitions
468
+ # getting revoked by the broker after reaching the max.poll.interval.ms
469
+ # Polling a paused consumer should never yield a message.
470
+ assert self.__consumer.poll(0.1) is None
453
471
  else:
454
472
  time.sleep(0.01)
455
473
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sentry-arroyo
3
- Version: 2.19.7
3
+ Version: 2.19.9
4
4
  Summary: Arroyo is a Python library for working with streaming data.
5
5
  Home-page: https://github.com/getsentry/arroyo
6
6
  Author: Sentry
@@ -1,6 +1,6 @@
1
1
  arroyo/__init__.py,sha256=fcpHZd2P3MxWl6PJJ8n__fM_NRIfiUE8tKN-orv6lb0,187
2
2
  arroyo/commit.py,sha256=oFihWUW8fLsjomWh0o085qIHe9vwVNgoOJC6JQdFM7M,2235
3
- arroyo/dlq.py,sha256=EMqjhC3tHBGcFNkyu6RFGQstYwM9Zvtd9Wz5oUwpZlM,15521
3
+ arroyo/dlq.py,sha256=BDmtJXrUKc8Pff7_AkRLE7accyyDkzakHe3mRPGJkNk,15631
4
4
  arroyo/errors.py,sha256=IbtoIbz_m5QrxNRBLOxiy-hOfJQTEwNPCyq6yqedJYk,1059
5
5
  arroyo/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  arroyo/types.py,sha256=sLY0x030np4UmbaW5C1KH1se7Z2pjQiPvAe5x2sXf7A,5684
@@ -16,7 +16,7 @@ arroyo/backends/local/storages/__init__.py,sha256=AGYujdAAcn3osoj9jq84IzTywYbkID
16
16
  arroyo/backends/local/storages/abstract.py,sha256=1qVQp6roxHkK6XT2aklZyZk1qq7RzcPN6Db_CA5--kg,2901
17
17
  arroyo/backends/local/storages/memory.py,sha256=AoKDsVZzBXkOJyWArKWp3vfGfU9xLlKFXE9gsJiMIzQ,2613
18
18
  arroyo/processing/__init__.py,sha256=vZVg0wJvJfoVzlzGvnL59bT6YNIRJNQ5t7oU045Qbk4,87
19
- arroyo/processing/processor.py,sha256=JtBWLNrFBNG9T174VIXHHW02gK5YJaJt4f5XoNDd_lU,19010
19
+ arroyo/processing/processor.py,sha256=RRLp8qcEL04TSvHaGuF0nc6RQ-HOiBzzI8nUwV5hZ2M,20025
20
20
  arroyo/processing/strategies/__init__.py,sha256=EU_JMb54eOxMxaC5mIFpI-sAF-X2ZScbE8czBZ7bQkY,1106
21
21
  arroyo/processing/strategies/abstract.py,sha256=nu7juEz_aQmQIH35Z8u--FBuLjkK8_LQ1hIG2xpw9AA,4808
22
22
  arroyo/processing/strategies/batching.py,sha256=s89xC6lQpBseEaApu1iNTipXGKeO95OMwinj2VBKn9s,4778
@@ -71,8 +71,8 @@ tests/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
71
  tests/utils/test_concurrent.py,sha256=Gwdzym2UZ1HO3rhOSGmzxImWcLFygY8P7MXHT3Q0xTE,455
72
72
  tests/utils/test_metrics.py,sha256=bI0EtGgPokMQyEqX58i0-8zvLfxRP2nWaWr2wLMaJ_o,917
73
73
  tests/utils/test_retries.py,sha256=AxJLkXWeL9AjHv_p1n0pe8CXXJp24ZQIuYBHfNcmiz4,3075
74
- sentry_arroyo-2.19.7.dist-info/LICENSE,sha256=0Ng3MFdEcnz0sVD1XvGBBzbavvNp_7OAM5yVObB46jU,10829
75
- sentry_arroyo-2.19.7.dist-info/METADATA,sha256=-NLUjXgKgabXzEOBUpgYTxnkme0tmeEBF0OvDuGOqas,1989
76
- sentry_arroyo-2.19.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
77
- sentry_arroyo-2.19.7.dist-info/top_level.txt,sha256=DVdMZKysL_iIxm5aY0sYgZtP5ZXMg9YBaBmGQHVmDXA,22
78
- sentry_arroyo-2.19.7.dist-info/RECORD,,
74
+ sentry_arroyo-2.19.9.dist-info/LICENSE,sha256=0Ng3MFdEcnz0sVD1XvGBBzbavvNp_7OAM5yVObB46jU,10829
75
+ sentry_arroyo-2.19.9.dist-info/METADATA,sha256=wmVhRiE5W4tvuCT3CCuAYsdi6q0ZjTPq8NxhA7zCuKA,1989
76
+ sentry_arroyo-2.19.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
77
+ sentry_arroyo-2.19.9.dist-info/top_level.txt,sha256=DVdMZKysL_iIxm5aY0sYgZtP5ZXMg9YBaBmGQHVmDXA,22
78
+ sentry_arroyo-2.19.9.dist-info/RECORD,,