Skip to content

Commit bdaacd0

Browse files
Merge branch 'k8snetworkplumbingwg:master' into network-operator-25.7.x
2 parents 2d7be8d + 1e69058 commit bdaacd0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
# Folders
1616
.gopath/
1717
.idea/
18-
bin/
19-
build/
18+
/bin/
19+
/build/

cmd/rdma/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"flag"
2020
"fmt"
2121
"os"
22+
"runtime"
2223

2324
"github.com/containernetworking/cni/pkg/skel"
2425
"github.com/containernetworking/cni/pkg/types"
@@ -34,6 +35,14 @@ import (
3435
"github.com/k8snetworkplumbingwg/rdma-cni/pkg/utils"
3536
)
3637

38+
//nolint:gochecknoinits
39+
func init() {
40+
// this ensures that main runs only on main thread (thread group leader).
41+
// since namespace ops (unshare, setns) are done for a single thread, we
42+
// must ensure that the goroutine does not jump from OS thread to thread
43+
runtime.LockOSThread()
44+
}
45+
3746
// Sets the initial log level configurations
3847
// this is overridden by the "debug" CNI arg
3948
var (

0 commit comments

Comments
 (0)