Skip to content

fix(firecracker): isolate JSON configuration file per container ID - #1043

Open
Norway-02 wants to merge 1 commit into
urunc-dev:mainfrom
Norway-02:fix/fc-config-collision
Open

Norway-02 wants to merge 1 commit into
urunc-dev:mainfrom
Norway-02:fix/fc-config-collision

Conversation

@Norway-02

@Norway-02 Norway-02 commented Sep 10, 2026

Copy link
Copy Markdown

Description

When launching containers using the Firecracker hypervisor (firecracker), firecracker.go previously assigned a static configuration file path at /tmp/fc.json. To prevent file collisions or race conditions across concurrent container creations on shared filesystems, this change updates Firecracker.BuildExecCmd to construct container-isolated configuration paths (/tmp/fc-<containerID>.json) using args.ContainerID when available, falling back gracefully to /tmp/fc.json when ContainerID is omitted.

Related issues

  • N/A

How was this tested?

  • Added dedicated unit tests in pkg/unikontainers/hypervisors/firecracker_test.go covering BuildExecCmd with and without ContainerID.
  • Ran unit tests with race detector and coverage: go test -v -race -cover ./pkg/unikontainers/hypervisors/... (100% pass, no race conditions).
  • Ran full unit test suite: go test -v ./pkg/... ./internal/... (all tests passed).

Reviewers

cc @cmainas @OdysseasKalaitsidis

LLM usage

none

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

Avoid file collisions on /tmp/fc.json when multiple Firecracker containers are spawned concurrently or in rapid succession. Use /tmp/fc-<containerID>.json when ContainerID is provided, falling back to /tmp/fc.json if empty.

Signed-off-by: Norway-02 <anshulkhetade02@gmail.com>
@netlify

netlify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploy Preview for urunc ready!

Name Link
🔨 Latest commit 8b56028
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6aa25573a071ff0009f5758f
😎 Deploy Preview https://deploy-preview-1043--urunc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cmainas cmainas added invalid This doesn't seem right do-not-merge labels Sep 10, 2026
@Norway-02

Copy link
Copy Markdown
Author

Hi @cmainas, I have updated the PR description and completed the checklist requirements according to the contribution guidelines. Could you please remove the invalid label and review when you get a chance? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants