fix: leave container memory swappiness unset by default - #7270
fix: leave container memory swappiness unset by default#7270huijoohwee wants to merge 3 commits into
Conversation
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
Could a maintainer help run the internal build for this change? The failed workflow stops at the fork-owner organization-membership check before compilation and directs external contributors to ask reviewers for assistance. The PR includes two focused schema/codec tests and a Podman reproduction where omitting MemorySwappiness changes container start from HTTP 500 to HTTP 204. The full Bazel and Workers/Sandbox E2E validation remains outstanding. The contributor CLA signature is also still pending. |
Container creation currently serializes
HostConfig.MemorySwappinessas0even when workerd never configures it. Podman accepts the create request, but crun on cgroup v2 rejects starting the container withcannot set memory swappiness with cgroupv2: OCI runtime error. This prevents the container egress sidecar from starting during local Workers development.Represent this optional JSON field with
Json.Value, so an uninitialized value is omitted while explicit numeric values, including zero, remain representable. This changes only the swappiness field; other default-valued request fields keep their existing encoding. No container-engine detection or request-rewriting proxy is added.The two focused KJ tests cover omission and explicit zero/nonzero values, and verify that
PublishAllPortsandStopTimeoutretain their encoding. The test target depends on the API schema and JSON codec rather than the complete container client/runtime.Validation
7077d443af81e94ea923e41b9990f697058e3b56: 2 passed.MemorySwappinessis present.MemorySwappiness: 0. Against rootless Podman 6.1.1, crun 1.29.1, Fedora 44, cgroup v2:git diff --checkpass.bazel test //src/workerd/server:docker-api-test@ //src/workerd/server:docker-api-test@all-autogates --jobs=4 --test_output=errors. Dependency extraction stopped with No space left on device before test execution. The local C++ tests above were then built directly with the pinned Cap'n Proto source via CMake. The Bazel targets, full workerd build, and full Workers/Sandbox E2E suite have not passed locally.Hosted checks
internal-buildstops before compilation because the fork owner is not a public Cloudflare organization member; an upstream maintainer will need to assist with that build. CLA Assistant also requires the contributor signature. Neither check is a successful build/test result.Minimal Podman reproduction
Use a running Podman Unix socket and an image already available to that engine. This reproduces the API distinction without Wrangler or a Docker CLI dependency. For macOS, the socket is reported by
podman machine inspect <machine> --format '{{.ConnectionInfo.PodmanSocket.Path}}'.On the environment above, the first start returns 500 with the crun swappiness error; the second returns 204 and exits zero. This addresses the workerd API failure independently of Wrangler's separate Podman build-flag compatibility issue (workers-sdk#9755).