Skip to content

Commit 64a37bb

Browse files
authored
feat(consumer): Make max poll time configurable (#51020)
Adds `max-poll-interval-ms` to the unified consumer CLI. We may want to pass in max poll time < 5 min to see if it helps mitigate INC-402
1 parent 5d6a254 commit 64a37bb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/sentry/consumers/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def get_stream_processor(
202202
auto_offset_reset: str,
203203
strict_offset_reset: bool,
204204
join_timeout: Optional[float],
205+
max_poll_interval_ms: Optional[int] = None,
205206
**options,
206207
) -> StreamProcessor:
207208
try:
@@ -254,6 +255,9 @@ def get_stream_processor(
254255
strict_offset_reset=strict_offset_reset,
255256
)
256257

258+
if max_poll_interval_ms is not None:
259+
consumer_config["max.poll.interval.ms"] = max_poll_interval_ms
260+
257261
consumer = KafkaConsumer(consumer_config)
258262

259263
return StreamProcessor(

src/sentry/runner/commands/run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,10 @@ def profiles_consumer(**options):
677677
help="Position in the commit log topic to begin reading from when no prior offset has been recorded.",
678678
)
679679
@click.option("--join-timeout", type=float, help="Join timeout in seconds.", default=None)
680+
@click.option(
681+
"--max-poll-interval-ms",
682+
type=int,
683+
)
680684
@strict_offset_reset_option()
681685
@configuration
682686
def basic_consumer(consumer_name, consumer_args, topic, **options):

0 commit comments

Comments
 (0)