Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Collaborator
Author
|
/ok to test b74e9d3 |
pimlock
marked this pull request as ready for review
September 21, 2026 22:41
pimlock
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
September 21, 2026 22:41
pimlock
marked this pull request as draft
September 21, 2026 22:46
|
Label |
pimlock
marked this pull request as ready for review
September 22, 2026 05:03
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
pimlock
force-pushed
the
fix-sandbox-fd-reclamation/pm
branch
from
September 22, 2026 05:25
4dbc2cd to
2b2b799
Compare
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep socket-heavy workloads from exhausting the sandbox broker's file descriptors and taking down the sandbox control connection.
Problem
The broker retains a file descriptor for each socket in a pre-connect state. When the workload closes one, the broker does not learn about it immediately. It removes the stale descriptor during cleanup.
The socket registry allows 4,096 metadata entries, but the broker may have a soft
RLIMIT_NOFILEof 1,024. Previously, cleanup normally started only when the registry filled orsocket(2)returnedEMFILE.For example:
/procor serve the control path.Connected sockets are different. The broker releases their source descriptors but keeps their metadata for policy mediation, so the metadata limit must remain separate from the descriptor limit.
Fix
Keep the 4,096-entry metadata limit and add a separate retained-descriptor budget. The budget uses the inherited soft
RLIMIT_NOFILE, subtracts descriptors already open at startup, and reserves 64 more for control-path work.With a soft limit of 1,024 and 24 descriptors already open, the broker can retain up to 936 pre-connect descriptors. Connected socket metadata can still use the full registry because those entries no longer retain broker descriptors.
Before opening another socket, the broker runs cleanup if either limit is full. If cleanup cannot free capacity, the workload receives
EMFILEwhile the broker keeps enough descriptors to scan/procand serve control traffic.Related Issue
No issue required. This is a localized reliability bug found while investigating a sandbox that stopped responding under socket churn.
Changes
Testing
mise run pre-commitmise run cimise run e2eChecklist