Skip to content

Commit

Permalink
Merge pull request #1911 from cpuguy83/fix_missing_lockosthread_master
Browse files Browse the repository at this point in the history
Lock goroutine to OS thread while changing NS
  • Loading branch information
mavenugo committed Aug 16, 2017
2 parents 860637f + 97725cd commit 5b28c0e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/overlay/ov_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 5b28c0e

Please sign in to comment.