Skip to content

feat: set --max-poll-interval-ms flags to Sentry/Snuba consumers#4376

Open
aldy505 wants to merge 1 commit into
masterfrom
aldy505/feat/kafka-max-poll-interval-config
Open

feat: set --max-poll-interval-ms flags to Sentry/Snuba consumers#4376
aldy505 wants to merge 1 commit into
masterfrom
aldy505/feat/kafka-max-poll-interval-config

Conversation

@aldy505

@aldy505 aldy505 commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Separated from #4313

Also introducint a healthcheck for snuba-replacer

Separated from #4313

Also introducint a healthcheck for snuba-replacer
Comment thread docker-compose.yml
Comment on lines 373 to +379
healthcheck:
<<: *file_healthcheck_defaults
snuba-replacer:
<<: *snuba_defaults
command: replacer --storage errors --auto-offset-reset=latest --no-strict-offset-reset
command: replacer --storage errors --auto-offset-reset=latest --no-strict-offset-reset --max-poll-interval-ms ${SENTRY_KAFKA_MAX_POLL_INTERVAL_MS:-300000}
healthcheck:
<<: *file_healthcheck_defaults

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The snuba-replacer service is missing the --health-check-file flag in its command, which will cause its healthcheck to fail permanently.
Severity: MEDIUM

Suggested Fix

Add the --health-check-file /tmp/health.txt flag to the command for the snuba-replacer service in docker-compose.yml to ensure the healthcheck file is created.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: docker-compose.yml#L373-L379

Potential issue: The `snuba-replacer` service is configured with a healthcheck that
depends on the existence of the file `/tmp/health.txt`. However, the service's `command`
is missing the `--health-check-file /tmp/health.txt` flag. This flag is necessary for
the process to create the health check file. Without it, the healthcheck will
consistently fail, and after the `HEALTHCHECK_FILE_START_PERIOD` of 600 seconds, Docker
will mark the container as permanently unhealthy.

Did we get this right? 👍 / 👎 to inform future reviews.

Comment thread .env
Comment on lines +51 to +52
# The default value is 30000 ms (30 seconds).
# SENTRY_KAFKA_MAX_POLL_INTERVAL_MS=30000

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The documented default for SENTRY_KAFKA_MAX_POLL_INTERVAL_MS in .env is 30000, but the docker-compose.yml default is 300000.
Severity: LOW

Suggested Fix

Align the documented default value in the .env file with the actual default value used in docker-compose.yml. Change the comment in .env to reflect the 300000 ms default.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .env#L51-L52

Potential issue: There is a mismatch between the documented default value for
`SENTRY_KAFKA_MAX_POLL_INTERVAL_MS` and its implementation. The comment in the `.env`
file states the default is `30000` ms, but the `docker-compose.yml` services use a
default of `300000` ms. This 10x difference could mislead users who rely on the
documentation, potentially causing them to set a much shorter interval than intended,
which could lead to the Kafka rebalancing issues this setting is designed to mitigate.

Did we get this right? 👍 / 👎 to inform future reviews.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 55c8540. Configure here.

Comment thread docker-compose.yml
command: replacer --storage errors --auto-offset-reset=latest --no-strict-offset-reset
command: replacer --storage errors --auto-offset-reset=latest --no-strict-offset-reset --max-poll-interval-ms ${SENTRY_KAFKA_MAX_POLL_INTERVAL_MS:-300000}
healthcheck:
<<: *file_healthcheck_defaults

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacer healthcheck missing heartbeat file

Medium Severity

snuba-replacer now uses the shared file-based healthcheck that succeeds only when /tmp/health.txt exists, but its replacer command never passes --health-check-file /tmp/health.txt like the other Snuba Kafka consumers. After the start period, Docker will mark the service unhealthy even while the replacer keeps running.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 55c8540. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant