sentry-arroyo 2.19.6__tar.gz → 2.19.8__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.
Files changed (89) hide show
  1. {sentry_arroyo-2.19.6/sentry_arroyo.egg-info → sentry_arroyo-2.19.8}/PKG-INFO +1 -1
  2. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/dlq.py +9 -6
  3. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/processor.py +22 -5
  4. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8/sentry_arroyo.egg-info}/PKG-INFO +1 -1
  5. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/setup.py +1 -1
  6. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/LICENSE +0 -0
  7. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/MANIFEST.in +0 -0
  8. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/README.md +0 -0
  9. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/__init__.py +0 -0
  10. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/__init__.py +0 -0
  11. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/abstract.py +0 -0
  12. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/kafka/__init__.py +0 -0
  13. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/kafka/commit.py +0 -0
  14. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/kafka/configuration.py +0 -0
  15. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/kafka/consumer.py +0 -0
  16. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/local/__init__.py +0 -0
  17. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/local/backend.py +0 -0
  18. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/local/storages/__init__.py +0 -0
  19. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/local/storages/abstract.py +0 -0
  20. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/backends/local/storages/memory.py +0 -0
  21. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/commit.py +0 -0
  22. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/errors.py +0 -0
  23. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/__init__.py +0 -0
  24. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/__init__.py +0 -0
  25. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/abstract.py +0 -0
  26. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/batching.py +0 -0
  27. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/buffer.py +0 -0
  28. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/commit.py +0 -0
  29. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/filter.py +0 -0
  30. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/guard.py +0 -0
  31. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/healthcheck.py +0 -0
  32. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/noop.py +0 -0
  33. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/produce.py +0 -0
  34. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/reduce.py +0 -0
  35. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/run_task.py +0 -0
  36. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/run_task_in_threads.py +0 -0
  37. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/run_task_with_multiprocessing.py +0 -0
  38. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/processing/strategies/unfold.py +0 -0
  39. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/py.typed +0 -0
  40. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/types.py +0 -0
  41. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/__init__.py +0 -0
  42. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/clock.py +0 -0
  43. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/codecs.py +0 -0
  44. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/concurrent.py +0 -0
  45. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/logging.py +0 -0
  46. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/metricDefs.json +0 -0
  47. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/metric_defs.py +0 -0
  48. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/metrics.py +0 -0
  49. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/profiler.py +0 -0
  50. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/arroyo/utils/retries.py +0 -0
  51. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/examples/transform_and_produce/__init__.py +0 -0
  52. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/examples/transform_and_produce/batched.py +0 -0
  53. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/examples/transform_and_produce/script.py +0 -0
  54. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/examples/transform_and_produce/simple.py +0 -0
  55. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/requirements.txt +0 -0
  56. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/sentry_arroyo.egg-info/SOURCES.txt +0 -0
  57. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/sentry_arroyo.egg-info/dependency_links.txt +0 -0
  58. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/sentry_arroyo.egg-info/not-zip-safe +0 -0
  59. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/sentry_arroyo.egg-info/requires.txt +0 -0
  60. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/sentry_arroyo.egg-info/top_level.txt +0 -0
  61. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/setup.cfg +0 -0
  62. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/backends/__init__.py +0 -0
  63. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/backends/mixins.py +0 -0
  64. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/backends/test_commit.py +0 -0
  65. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/backends/test_kafka.py +0 -0
  66. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/backends/test_local.py +0 -0
  67. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/__init__.py +0 -0
  68. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/__init__.py +0 -0
  69. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_all.py +0 -0
  70. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_batching.py +0 -0
  71. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_buffer.py +0 -0
  72. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_commit.py +0 -0
  73. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_filter.py +0 -0
  74. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_guard.py +0 -0
  75. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_noop.py +0 -0
  76. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_produce.py +0 -0
  77. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_reduce.py +0 -0
  78. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_run_task.py +0 -0
  79. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_run_task_in_threads.py +0 -0
  80. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_run_task_with_multiprocessing.py +0 -0
  81. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/strategies/test_unfold.py +0 -0
  82. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/processing/test_processor.py +0 -0
  83. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/test_commit.py +0 -0
  84. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/test_dlq.py +0 -0
  85. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/test_types.py +0 -0
  86. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/utils/__init__.py +0 -0
  87. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/utils/test_concurrent.py +0 -0
  88. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/utils/test_metrics.py +0 -0
  89. {sentry_arroyo-2.19.6 → sentry_arroyo-2.19.8}/tests/utils/test_retries.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sentry-arroyo
3
- Version: 2.19.6
3
+ Version: 2.19.8
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
@@ -44,11 +44,12 @@ class InvalidMessage(Exception):
44
44
  """
45
45
 
46
46
  def __init__(
47
- self, partition: Partition, offset: int, needs_commit: bool = True
47
+ self, partition: Partition, offset: int, needs_commit: bool = True, reason: Optional[str] = None,
48
48
  ) -> None:
49
49
  self.partition = partition
50
50
  self.offset = offset
51
51
  self.needs_commit = needs_commit
52
+ self.reason = reason
52
53
 
53
54
  @classmethod
54
55
  def from_value(cls, value: BrokerValue[Any]) -> InvalidMessage:
@@ -177,7 +178,7 @@ class DlqLimitState:
177
178
  class DlqProducer(ABC, Generic[TStrategyPayload]):
178
179
  @abstractmethod
179
180
  def produce(
180
- self, value: BrokerValue[TStrategyPayload]
181
+ self, value: BrokerValue[TStrategyPayload], reason: Optional[str] = None
181
182
  ) -> Future[BrokerValue[TStrategyPayload]]:
182
183
  """
183
184
  Produce a message to DLQ.
@@ -201,7 +202,7 @@ class NoopDlqProducer(DlqProducer[Any]):
201
202
  """
202
203
 
203
204
  def produce(
204
- self, value: BrokerValue[KafkaPayload]
205
+ self, value: BrokerValue[KafkaPayload], reason: Optional[str] = None,
205
206
  ) -> Future[BrokerValue[KafkaPayload]]:
206
207
  future: Future[BrokerValue[KafkaPayload]] = Future()
207
208
  future.set_running_or_notify_cancel()
@@ -229,7 +230,9 @@ class KafkaDlqProducer(DlqProducer[KafkaPayload]):
229
230
  self.__topic = topic
230
231
 
231
232
  def produce(
232
- self, value: BrokerValue[KafkaPayload]
233
+ self,
234
+ value: BrokerValue[KafkaPayload],
235
+ reason: Optional[str] = None,
233
236
  ) -> Future[BrokerValue[KafkaPayload]]:
234
237
  value.payload.headers.append(
235
238
  ("original_partition", f"{value.partition.index}".encode("utf-8"))
@@ -353,7 +356,7 @@ class DlqPolicyWrapper(Generic[TStrategyPayload]):
353
356
  self.__dlq_policy.limit, assignment
354
357
  )
355
358
 
356
- def produce(self, message: BrokerValue[TStrategyPayload]) -> None:
359
+ def produce(self, message: BrokerValue[TStrategyPayload], reason: Optional[str] = None) -> None:
357
360
  """
358
361
  Removes all completed futures, then appends the given future to the list.
359
362
  Blocks if the list is full. If the DLQ limit is exceeded, an exception is raised.
@@ -371,7 +374,7 @@ class DlqPolicyWrapper(Generic[TStrategyPayload]):
371
374
 
372
375
  should_accept = self.__dlq_limit_state.record_invalid_message(message)
373
376
  if should_accept:
374
- future = self.__dlq_policy.producer.produce(message)
377
+ future = self.__dlq_policy.producer.produce(message, reason)
375
378
  self.__futures[message.partition].append((message, future))
376
379
  else:
377
380
  raise RuntimeError("Dlq limit exceeded")
@@ -376,7 +376,7 @@ class StreamProcessor(Generic[TStrategyPayload]):
376
376
  ) from None
377
377
 
378
378
  # XXX: This blocks if there are more than MAX_PENDING_FUTURES in the queue.
379
- self.__dlq_policy.produce(invalid_message)
379
+ self.__dlq_policy.produce(invalid_message, exc.reason)
380
380
 
381
381
  self.__metrics_buffer.incr_timing(
382
382
  "arroyo.consumer.dlq.time", time.time() - start_dlq
@@ -446,10 +446,27 @@ class StreamProcessor(Generic[TStrategyPayload]):
446
446
  self.__is_paused = True
447
447
 
448
448
  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
449
+ paused_partitions = set(self.__consumer.paused())
450
+ unpaused_partitions = (
451
+ set(self.__consumer.tell()) - paused_partitions
452
+ )
453
+ if unpaused_partitions:
454
+ logger.warning(
455
+ "Processor in paused state while consumer is partially unpaused: %s, paused: %s",
456
+ unpaused_partitions,
457
+ paused_partitions,
458
+ )
459
+ self.__is_paused = False
460
+ # unpause paused partitions... just in case a subset is paused
461
+ self.__metrics_buffer.incr_counter(
462
+ "arroyo.consumer.resume", 1
463
+ )
464
+ self.__consumer.resume([*paused_partitions])
465
+ else:
466
+ # A paused consumer should still poll periodically to avoid it's partitions
467
+ # getting revoked by the broker after reaching the max.poll.interval.ms
468
+ # Polling a paused consumer should never yield a message.
469
+ assert self.__consumer.poll(0.1) is None
453
470
  else:
454
471
  time.sleep(0.01)
455
472
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sentry-arroyo
3
- Version: 2.19.6
3
+ Version: 2.19.8
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
@@ -10,7 +10,7 @@ def get_requirements() -> Sequence[str]:
10
10
 
11
11
  setup(
12
12
  name="sentry-arroyo",
13
- version="2.19.6",
13
+ version="2.19.8",
14
14
  author="Sentry",
15
15
  author_email="oss@sentry.io",
16
16
  license="Apache-2.0",
File without changes
File without changes
File without changes