From f5e7ca8a54e2489e3c0b7fd18496901b23f240d4 Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Thu, 4 Sep 2025 16:37:22 -0400 Subject: [PATCH 1/4] this line is 30% of the last 60 minutes of logs --- packages/orchestrator/internal/sandbox/uffd/serve.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/orchestrator/internal/sandbox/uffd/serve.go b/packages/orchestrator/internal/sandbox/uffd/serve.go index a10afa50b6..bce2db84bc 100644 --- a/packages/orchestrator/internal/sandbox/uffd/serve.go +++ b/packages/orchestrator/internal/sandbox/uffd/serve.go @@ -108,8 +108,6 @@ outerLoop: } if err == syscall.EAGAIN { - logger.Debug("uffd: eagain error, going back to polling", zap.Error(err), zap.Int("read_bytes", n)) - // Continue polling the fd. continue outerLoop } From 10ac311a77f12962ed31ce140b65a362b4ed0136 Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Thu, 4 Sep 2025 16:42:25 -0400 Subject: [PATCH 2/4] EAGAIN implies that we should wait a little --- packages/orchestrator/internal/sandbox/uffd/serve.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/orchestrator/internal/sandbox/uffd/serve.go b/packages/orchestrator/internal/sandbox/uffd/serve.go index bce2db84bc..3f3f1fe03f 100644 --- a/packages/orchestrator/internal/sandbox/uffd/serve.go +++ b/packages/orchestrator/internal/sandbox/uffd/serve.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "syscall" + "time" "unsafe" "go.uber.org/zap" @@ -54,6 +55,7 @@ outerLoop: } if err == unix.EAGAIN { + time.Sleep(time.Millisecond) logger.Debug("uffd: eagain during polling, going back to polling") continue @@ -109,6 +111,7 @@ outerLoop: if err == syscall.EAGAIN { // Continue polling the fd. + time.Sleep(time.Millisecond) continue outerLoop } From 49d9204bb58c27b7ea64141e4edaad10a34757ce Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Thu, 4 Sep 2025 16:51:46 -0400 Subject: [PATCH 3/4] remove unused variable --- packages/orchestrator/internal/sandbox/uffd/serve.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/orchestrator/internal/sandbox/uffd/serve.go b/packages/orchestrator/internal/sandbox/uffd/serve.go index 3f3f1fe03f..f9e2a1f3dc 100644 --- a/packages/orchestrator/internal/sandbox/uffd/serve.go +++ b/packages/orchestrator/internal/sandbox/uffd/serve.go @@ -97,7 +97,7 @@ outerLoop: buf := make([]byte, unsafe.Sizeof(userfaultfd.UffdMsg{})) for { - n, err := syscall.Read(uffd, buf) + _, err := syscall.Read(uffd, buf) if err == syscall.EINTR { logger.Debug("uffd: interrupted read, reading again") From 31b90a45dc40e0cc30a69c924b9788cfb88dcc49 Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Sat, 6 Sep 2025 13:51:04 -0400 Subject: [PATCH 4/4] remove the sleeps, one thing at a time! --- packages/orchestrator/internal/sandbox/uffd/serve.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/orchestrator/internal/sandbox/uffd/serve.go b/packages/orchestrator/internal/sandbox/uffd/serve.go index f9e2a1f3dc..6e719a3df2 100644 --- a/packages/orchestrator/internal/sandbox/uffd/serve.go +++ b/packages/orchestrator/internal/sandbox/uffd/serve.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "syscall" - "time" "unsafe" "go.uber.org/zap" @@ -55,7 +54,6 @@ outerLoop: } if err == unix.EAGAIN { - time.Sleep(time.Millisecond) logger.Debug("uffd: eagain during polling, going back to polling") continue @@ -111,7 +109,6 @@ outerLoop: if err == syscall.EAGAIN { // Continue polling the fd. - time.Sleep(time.Millisecond) continue outerLoop }