feat: set --max-poll-interval-ms flags to Sentry/Snuba consumers#4376
feat: set --max-poll-interval-ms flags to Sentry/Snuba consumers#4376aldy505 wants to merge 1 commit into
Conversation
Separated from #4313 Also introducint a healthcheck for snuba-replacer
| 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 |
There was a problem hiding this comment.
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.
| # The default value is 30000 ms (30 seconds). | ||
| # SENTRY_KAFKA_MAX_POLL_INTERVAL_MS=30000 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
| 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 |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 55c8540. Configure here.


Separated from #4313
Also introducint a healthcheck for snuba-replacer