Merge pull request #1911 from cpuguy83/fix_missing_lockosthread_master

Lock goroutine to OS thread while changing NS
This commit is contained in:
Madhu Venugopal
2017-08-16 09:36:29 -07:00
committed by GitHub

View File

@@ -8,6 +8,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
@@ -81,6 +82,10 @@ func setDefaultVlan() {
logrus.Error("insufficient number of arguments")
os.Exit(1)
}
runtime.LockOSThread()
defer runtime.UnlockOSThread()
nsPath := os.Args[1]
ns, err := netns.GetFromPath(nsPath)
if err != nil {