Skip to content

An open-source, faster Devin alternative

TypeScript

fixes

Brian Reardonf348bdf9ed5e
diff --git a/cmd/oc/internal/commands/exec.go b/cmd/oc/internal/commands/exec.go
index 961207b6..db5c63af 100644
--- a/cmd/oc/internal/commands/exec.go
+++ b/cmd/oc/internal/commands/exec.go
@@ -3,7 +3,6 @@ package commands
import (
"fmt"
"os"
- "strings"
"github.com/opensandbox/opensandbox/cmd/oc/internal/client"
"github.com/opensandbox/opensandbox/pkg/types"
@@ -28,18 +27,11 @@ Examples:
sandboxID := args[0]
- // Find the "--" separator to split sandbox flags from command
- cmdArgs := cmd.Flags().Args()
- var command string
- if len(cmdArgs) > 1 {
- command = strings.Join(cmdArgs[1:], " ")
- } else if len(args) > 1 {
- command = strings.Join(args[1:], " ")
- }
-
- if command == "" {
+ if len(args) < 2 {
return fmt.Errorf("no command specified. Usage: oc exec <sandbox-id> -- <command>")
}
+ command := args[1]
+ cmdArgs := args[2:]
cwd, _ := cmd.Flags().GetString("cwd")
timeout, _ := cmd.Flags().GetInt("timeout")
@@ -47,6 +39,7 @@ Examples:
req := types.ProcessConfig{
Command: command,
+ Args: cmdArgs,
Cwd: cwd,
Timeout: timeout,
Env: parseKVSlice(envSlice),
diff --git a/cmd/oc/internal/commands/sandbox.go b/cmd/oc/internal/commands/sandbox.go
index f7902e6f..60ee7893 100644
--- a/cmd/oc/internal/commands/sandbox.go
+++ b/cmd/oc/internal/commands/sandbox.go
@@ -21,7 +21,6 @@ var sandboxCreateCmd = &cobra.Command{
RunE: func(cmd *cobra.Command, args []string) error {
c := client.FromContext(cmd.Context())
- template, _ := cmd.Flags().GetString("template")
timeout, _ := cmd.Flags().GetInt("timeout")
cpu, _ := cmd.Flags().GetInt("cpu")
memory, _ := cmd.Flags().GetInt("memory")
@@ -29,7 +28,6 @@ var sandboxCreateCmd = &cobra.Command{
metaSlice, _ := cmd.Flags().GetStringSlice("metadata")
config := types.SandboxConfig{
- Template: template,
Timeout: timeout,
CpuCount: cpu,
MemoryMB: memory,
@@ -211,7 +209,6 @@ var lsShortcut = &cobra.Command{
func init() {
// sandbox create flags
for _, cmd := range []*cobra.Command{sandboxCreateCmd, createShortcut} {
- cmd.Flags().String("template", "base", "Template to use")
cmd.Flags().Int("timeout", 300, "Timeout in seconds")
cmd.Flags().Int("cpu", 0, "CPU count")
cmd.Flags().Int("memory", 0, "Memory in MB")
diff --git a/cmd/oc/internal/commands/shell.go b/cmd/oc/internal/commands/shell.go
index 23d56cb7..36492be6 100644
--- a/cmd/oc/internal/commands/shell.go
+++ b/cmd/oc/internal/commands/shell.go
@@ -126,7 +126,6 @@ Examples:
// Cleanup: kill PTY session
signal.Stop(sigWinch)
- term.Restore(fd, oldState)
ptyClient.Delete(cmd.Context(), fmt.Sprintf("/sandboxes/%s/pty/%s", sandboxID, session.SessionID))
return nil
diff --git a/internal/firecracker/snapshot.go b/internal/firecracker/snapshot.go
index 2d592336..e5ae5a1c 100644
--- a/internal/firecracker/snapshot.go
+++ b/internal/firecracker/snapshot.go
@@ -2034,12 +2034,15 @@ func (m *Manager) PrepareGoldenSnapshot() error {
// Step 3: Flush filesystem, quiesce network, close agent, pause VM, snapshot
_ = agent.SyncFS(context.Background())
- // Bring eth0 down to drain virtio-net queues cleanly. Without this,
- // snapshot restore with a different TAP backend causes virtqueue corruption
- // ("output.0:id 0 is not a head!") and a soft lockup in the guest kernel.
+ // Quiesce eth0 before snapshotting to ensure clean virtio-net virtqueues.
+ // Flush all addresses first so the host stops sending ARP/IPv6 ND traffic to
+ // this TAP, eliminating the race where a packet arrives in the RX used ring
+ // while NAPI is draining. Without this, snapshot restore triggers
+ // "input.0:id 0 is not a head!" (vq->broken=true) which permanently breaks
+ // virtio-net RX for every sandbox created from this golden snapshot.
_, _ = agent.Exec(context.Background(), &pb.ExecRequest{
Command: "/bin/sh",
- Args: []string{"-c", "ip link set eth0 down"},
+ Args: []string{"-c", "ip addr flush dev eth0 && ip link set eth0 down"},
TimeoutSeconds: 5,
})