소스 검색

Merge pull request #1911 from cpuguy83/fix_missing_lockosthread_master

Lock goroutine to OS thread while changing NS
Madhu Venugopal 7 년 전
부모
커밋
07354ab656
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      libnetwork/drivers/overlay/ov_network.go

+ 5 - 0
libnetwork/drivers/overlay/ov_network.go

@@ -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 {