udp_linux: wrap socket operations with syscall.RawConn for clean teardown (#1654)
Some checks failed
gofmt / Run gofmt (push) Failing after 3s
smoke-extra / Run extra smoke tests (push) Failing after 2s
smoke / Run multi node smoke test (push) Failing after 3s
Build and test / Build all and test on ubuntu-linux (push) Failing after 3s
Build and test / Build and test on linux with boringcrypto (push) Failing after 2s
Build and test / Build and test on linux with pkcs11 (push) Failing after 2s
Build and test / Build and test on macos-latest (push) Has been cancelled
Build and test / Build and test on windows-latest (push) Has been cancelled

remove runtime.LockOSThread() because it makes things worse now

remove the "custom" Write() method from tun_linux.go, the stdlib path via os.File performs better

We should change our guidance around number of routines, ~2 per thread (that you wish to use for Nebula) seems to be about right now
This commit is contained in:
Jack Doan
2026-04-14 18:25:24 -05:00
committed by GitHub
parent 3fae693c42
commit b3194236aa
3 changed files with 162 additions and 188 deletions

View File

@@ -7,7 +7,6 @@ import (
"io"
"net/netip"
"os"
"runtime"
"sync/atomic"
"time"
@@ -263,8 +262,6 @@ func (f *Interface) run() {
}
func (f *Interface) listenOut(i int) {
runtime.LockOSThread()
var li udp.Conn
if i > 0 {
li = f.writers[i]
@@ -285,8 +282,6 @@ func (f *Interface) listenOut(i int) {
}
func (f *Interface) listenIn(reader io.ReadWriteCloser, i int) {
runtime.LockOSThread()
packet := make([]byte, mtu)
out := make([]byte, mtu)
fwPacket := &firewall.Packet{}