Skip to content

fix(nbd): change NBD status poll sleep from 100ns to 100µs to avoid useless busy spinning#2884

Open
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:fix-nbd-poll-sleep-100us
Open

fix(nbd): change NBD status poll sleep from 100ns to 100µs to avoid useless busy spinning#2884
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:fix-nbd-poll-sleep-100us

Conversation

@AdaAibaby
Copy link
Copy Markdown
Contributor

fix(nbd): adjust status poll sleep from 100ns to 100µs

Optimize NBD connected check polling interval:

  • Original 100ns causes useless busy spin since nbdnl.Connect() is sync netlink call;
  • New 100µs yields CPU safely without any functional regression;
  • Open/Close path have ctx & 30s timeout guard, rootfs start runs in separate goroutine, no side effect for sandbox rootfs lifecycle.
    /cc @jakubno

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the polling sleep interval in path_direct.go from 100 nanoseconds to 100 microseconds during NBD connection and disconnection retries, likely to reduce CPU usage. There are no review comments, and I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants