Skip to content

feat(healthcheck): Add a healthcheck command for consumer liveness probes - #580

Merged
oioki merged 3 commits into
mainfrom
feat/healthcheck-command
Oct 13, 2026
Merged

oioki merged 3 commits into
mainfrom
feat/healthcheck-command

Conversation

@oioki

@oioki oioki commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Add python3 -m arroyo.healthcheck <path>. It removes the file the Healthcheck strategy touches, or exits 1 with <path> is missing: the consumer has not touched it since the last probe. It's meant to run as the consumer's Kubernetes liveness probe.

Consumers run this check today as rm /tmp/health.txt, which needs a shell image and doesn't work on distroless. As a stopgap, ops carries an inline python3 -c "import os; os.remove(...)" snippet in sentry (getsentry/ops#24151), snuba (getsentry/ops#21290) and super-big-consumers (getsentry/ops#21394), with a traceback as the error message. Arroyo writes the file, so it should own the check, the same way taskbroker_client now owns the taskworker's (getsentry/taskbroker#814).

The module imports only the standard library and arroyo's top-level package (about 0.06s), not the Kafka client or the processing strategies. That matters because the probe runs every 10s in every consumer pod. For comparison, a sentry CLI subcommand would cost about 1s per probe, since it loads Django.

oioki and others added 2 commits October 13, 2026 19:25
…obes

Add `python3 -m arroyo.healthcheck <path>`, which removes the file the
Healthcheck strategy touches, or exits 1 with a one-line message if it
is missing.

Consumers run this check today as `rm <path>`, which needs a shell
image, or as an inline `python3 -c` snippet in each deployment. Arroyo
writes the file, so it should own the check too. The module imports
only the standard library and `arroyo`, so it stays cheap enough to run
every few seconds.

Co-Authored-By: Claude <noreply@anthropic.com>
Match the taskbroker client commands, which test behavior only.

Co-Authored-By: Claude <noreply@anthropic.com>
@oioki
oioki force-pushed the feat/healthcheck-command branch from 31065eb to 1b5aa2c Compare October 13, 2026 17:35
Keep the explanation on the function, like the taskbroker client commands.

Co-Authored-By: Claude <noreply@anthropic.com>
@oioki
oioki marked this pull request as ready for review October 13, 2026 17:42
@oioki
oioki requested review from a team as code owners October 13, 2026 17:42
@oioki
oioki merged commit 7a8dd1a into main Oct 13, 2026
22 checks passed
@oioki
oioki deleted the feat/healthcheck-command branch October 13, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants