Skip to content

fix(master): refuse tmpfs options Swarm cannot express - #65

Open
echobt wants to merge 1 commit into
mainfrom
fix/swarm-tmpfs-refuse-undroppable-options
Open

fix(master): refuse tmpfs options Swarm cannot express#65
echobt wants to merge 1 commit into
mainfrom
fix/swarm-tmpfs-refuse-undroppable-options

Conversation

@echobt

@echobt echobt commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Why

The Swarm backend translated a docker-run tmpfs spec by keeping size= and discarding every other option.

The own_runner job container installs the miner agent into /tmp/.local under a read-only rootfs, so its spec is /tmp:rw,nosuid,exec,size=2g. tmpfs is noexec unless told otherwise. Routing that workload through Swarm produced a noexec /tmp, where the agent loads no shared object and dies with failed to map segment from shared object — the same symptom that already cost hours to trace on the broker path (fixed in #64).

The broker path is what production runs today, so this was latent, not live. It becomes live the moment the Swarm path is enabled.

What

Swarm cannot express the flag at all. Verified against Docker 29.2.1 on the prod host:

attempt result
type=tmpfs,...,exec invalid field 'exec' must be a key=value pair
type=tmpfs,...,tmpfs-options=exec unknown option 'tmpfs-options'
type=tmpfs,destination=/tmp,tmpfs-size=1048576 parses (fails later only because the node is not a swarm manager)

So translation is impossible and silence is the worst option. This change:

  • translates size= and mode= to tmpfs-size / tmpfs-mode;
  • accepts the flags Swarm already applies by default (rw, noexec, nosuid, nodev);
  • refuses exec, and refuses any other untranslatable option, instead of dropping it.

Tests

New tests/unit/test_swarm_tmpfs_exec.py, written failing first: the two refusal tests failed with DID NOT RAISE before the change while the three translation tests already passed, pinning that existing specs keep working. 5 passed after.

The Swarm backend translated a docker-run tmpfs spec by keeping size= and
discarding everything else. The own_runner job container installs the miner
agent into /tmp/.local under a read-only rootfs, so its spec carries exec;
tmpfs is noexec unless told otherwise. Routing that workload through Swarm
therefore produced a noexec /tmp, where the agent loads no shared object and
fails with "failed to map segment from shared object" -- a symptom that took
hours to trace back to a dropped mount flag.

Swarm cannot express the flag at all: against Docker 29.2.1 a bare exec is
rejected as a non key=value field and tmpfs-options is an unknown option, so
only tmpfs-size and tmpfs-mode survive. Translate those two, accept the flags
Swarm already applies by default, and refuse anything else -- exec loudest of
all -- rather than dropping it and failing far from the cause.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@echobt, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a1074551-b672-4846-9614-9972546d7739

📥 Commits

Reviewing files that changed from the base of the PR and between 7b076d3 and 62e55f7.

📒 Files selected for processing (2)
  • src/base/master/swarm_backend.py
  • tests/unit/test_swarm_tmpfs_exec.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant