Skip to content

fix(cmd/urunc): add fail-fast exec stub to fix Argo Workflows hang - #883

Draft
Anand-240 wants to merge 1 commit into
urunc-dev:mainfrom
Anand-240:fix/urunc-exec-stub
Draft

fix(cmd/urunc): add fail-fast exec stub to fix Argo Workflows hang#883
Anand-240 wants to merge 1 commit into
urunc-dev:mainfrom
Anand-240:fix/urunc-exec-stub

Conversation

@Anand-240

Copy link
Copy Markdown
Contributor

What this does

urunc had no exec OCI-runtime subcommand at all. containerd-shim-runc-v2/go-runc invoke <runtime> exec --process <spec.json> [flags] <container-id> to signal sidecar containers in a pod. This is how Argo Workflows tells its wait sidecar a step is done via kubectl exec. Because RuntimeClass is pod-scoped, that exec call gets routed through urunc's shim for every container in the pod, including plain-Linux sidecars, and previously failed with urfave/cli's generic "No help topic for 'exec'" error.

That failure was indistinguishable from "urunc is broken", so callers like Argo's workflow-controller retried it forever instead of failing cleanly. The workflow just hangs in Running permanently. Full reproduction and root-cause writeup: #882.

What this PR adds

A minimal exec subcommand (cmd/urunc/exec.go) that:

  • Accepts the exact CLI shape go-runc sends (--process, --console-socket, --detach, --pid-file, <container-id>), so parsing doesn't fail
  • Fails fast with a clear, distinct error ("exec is not supported by urunc: ...") and a dedicated exit code (255, matching runc's own convention for exec failures)
  • Is registered in main.go's command list

Plus unit tests (cmd/urunc/exec_test.go) and a new test_cmd_urunc Makefile target wired into unittest (this package had no test coverage before).

What this PR intentionally does NOT do

This is a fail-fast stub, not a real "exec a process inside a running unikernel" implementation. That would need something like a guest-agent/virtio-console channel into the VM, and doesn't apply uniformly across urunc's supported unikernel types. It also isn't verifiable without a KVM-capable environment. Flagging it as a possible separate future issue, not attempting it here.

Testing

Since this was developed on a Mac and cmd/urunc can't build natively there (it cgo-links runc/libcontainer/nsenter, Linux-only), all verification below ran in a Linux container:

  • go build ./cmd/urunc/...: clean
  • go vet ./cmd/urunc/...: clean
  • go test ./cmd/urunc/... -v: 4/4 new tests pass
  • golangci-lint run (project's .golangci.yml, golangci-lint:v2.9): zero issues in the new/changed code (one pre-existing, unrelated ineffassign in create.go remains, not touched by this PR)

Fixes #882

@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit e79cd04
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a6f1b0a1c9eda0008c650ff

containerd-shim-runc-v2/go-runc invoke `urunc exec` to signal sidecar
containers in a pod (e.g. Argo Workflows' wait container) via kubectl
exec. urunc had no exec subcommand at all, so this call failed with an
opaque CLI-usage error ("No help topic for 'exec'") that callers could
not distinguish from "urunc is broken". This caused Argo workflows using
runtimeClassName: urunc to hang in Running forever, since the sidecar
could never be signaled to terminate.

This adds a minimal exec subcommand that accepts the same CLI shape
go-runc sends (--process, --console-socket, --detach, --pid-file,
<container-id>) and fails fast with a clear "not supported" error and
a dedicated exit code (255, matching runc's own convention), instead
of the previous unknown-command failure. This is intentionally a
fail-fast stub, not a real exec-into-unikernel implementation. See
the doc comment on execCommand for why that's a separate, larger
problem out of scope here.

Fixes urunc-dev#882

Signed-off-by: Anand-240 <anandprakashsrivastava68@gmail.com>
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.

urunc has no exec OCI-runtime subcommand, causing Argo Workflows (and any exec-dependent controller) to hang forever

1 participant