Repository navigation
fix(compose): tunnel sidecar healthcheck used pgrep, absent from the image - #151
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 541fa0c16e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # control channel was established the whole time). dumb-init keeps | ||
| # the rathole process a direct child, so its cmdline is always in | ||
| # the /proc scan. | ||
| test: ["CMD-SHELL", "grep -q rathole /proc/[0-9]*/cmdline"] |
There was a problem hiding this comment.
Prevent the healthcheck from matching its own command line
When the sidecar is waiting for /config/client.toml, no rathole process exists, but this probe still succeeds: /bin/sh -c includes the literal rathole in its own /proc/<pid>/cmdline, which the glob includes. Thus the sidecar reports healthy even before the client starts. I reproduced this with an otherwise unused, randomly generated search token: the same probe returned 0. As local grep --help states, it searches for patterns in each supplied file, including the probe shell's cmdline here. Exclude the probe itself, for example by using [r]athole as the pattern, or check the actual client process explicitly.
Useful? React with 👍 / 👎.
…age does not ship The exec healthcheck failed with 'pgrep: executable file not found' from the first probe — a permanently-unhealthy container over a healthy tunnel (the control channel was established the whole time; found live in the F7 tunnel e2e bring-up). Probe /proc comm with grep (present in the image): comm carries only the executable name, so the probe's own command line (which contains the word rathole) cannot satisfy it — a cmdline scan would report an unconfigured sidecar as healthy while the entrypoint is still waiting for client.toml (codex review). dumb-init keeps the rathole process a direct child, so its comm is always in the scan.
541fa0c to
a1dbe16
Compare
The healthcheck exec'd pgrep, which the sidecar image doesn't ship — unhealthy from the first probe while the tunnel was actually up (control channel established). Scan /proc cmdlines with grep (present; dumb-init keeps rathole a direct child). Verified live: the same check reports healthy on the running sidecar.