Unify descriptor managment into LiteBox core#722
Merged
jaybosamiya-ms merged 15 commits intomainfrom Mar 17, 2026
Merged
Conversation
These were intended to eventually be public, but were locked down in the past. Now that things are a bit more stable, we can actually make these public.
This was a non-trivial change since it required migrating a bunch of code up to actually use raw FDs everywhere, but this should make the next commit (hopefully) simpler to read.
This gets rid of the `__Unused`, but introduces some clippy things to be cleaned up, but I wanted to keep this particular commit quite "obvious" on its own to see in the diff.
c87e164 to
c454122
Compare
wdcui
reviewed
Mar 14, 2026
|
🤖 SemverChecks 🤖 No breaking API changes detected Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered. |
wdcui
approved these changes
Mar 16, 2026
Member
wdcui
left a comment
There was a problem hiding this comment.
Feel free to resolve my last comment and merge this PR when you are ready.
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.
This PR fully eliminates the descriptor table indirection we had in the shim, now relying entirely on the LiteBox core to manage file descriptors both for raw FDs as well as the typed FDs.
To do this, I've made the following changes at the core litebox crate:
liteboxcrates to defineFdEnabledSubsystems, as a stabilized interfaceEntryHandleinterface, that allows entry-specific locking outsideliteboxwithout maintaining a full descriptor table lockAt the shim, roughly it boils down to "remove
Descriptors+Descriptor" and deal with the consequences. The changes are quite extensive but are not particularly insightful in any major way. I did clean up a few bugs along the way where (say) rlimits might not have been adhered to, or if two descriptors are made and the second one hit an rlimit issue, then there could have been a leak, etc.Despite removing a chunk of code, some other code did get a tiny bit more bloated, but the level of indirection is smaller. I think we can further clean this up by removing some of the redundancy, but I think merging this in sooner than that is probably the better move, thus I've opened the PR in the current state.
Related: #31