On 2019/12/17 05:51, Montes, Julio wrote:
Hi Stefano
This patch [1] moves the runtime to the sandbox's (qemu) net namespace. This patch is a hotfix that should be used only for testing
Julio
[1] - https://github.com/devimc/kata-runtime/commit/656d518da223ecff9a9086be514073...
+func (n *Network) Set(netNSPath string) error { + span, _ := n.trace(context.Background(), "run") + defer span.Finish() + + runtime.LockOSThread() + defer runtime.UnlockOSThread() + + targetNS, err := ns.GetNS(netNSPath) + if err != nil { + return err + } + + if err := targetNS.Set(); err != nil { + return err + } + + return nil +}
kata shimv2 has two Ms. I don't think it can work by just setting one thread's netns. The result is that netns is randomly set for shimv2 goroutines.
containerd-shim-v2/service.go: cmd.Env = append(os.Environ(), "GOMAXPROCS=2")
Cheers, Tao