Skip to content

Unify descriptor managment into LiteBox core#722

Merged
jaybosamiya-ms merged 15 commits intomainfrom
jayb/fd-cleanup
Mar 17, 2026
Merged

Unify descriptor managment into LiteBox core#722
jaybosamiya-ms merged 15 commits intomainfrom
jayb/fd-cleanup

Conversation

@jaybosamiya-ms
Copy link
Member

@jaybosamiya-ms jaybosamiya-ms commented Mar 13, 2026

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:

  • Explicitly started allowing for non-litebox crates to define FdEnabledSubsystems, as a stabilized interface
  • Exposed some public interfaces to interact more with the descriptor tables
  • Introduced a EntryHandle interface, that allows entry-specific locking outside litebox without maintaining a full descriptor table lock

At 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

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.
@jaybosamiya-ms jaybosamiya-ms marked this pull request as ready for review March 13, 2026 02:30
@jaybosamiya-ms jaybosamiya-ms requested a review from wdcui March 13, 2026 02:31
@github-actions
Copy link

🤖 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.

Copy link
Member

@wdcui wdcui left a comment

Choose a reason for hiding this comment

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

Feel free to resolve my last comment and merge this PR when you are ready.

@jaybosamiya-ms jaybosamiya-ms added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit 9c0ab32 Mar 17, 2026
14 checks passed
@jaybosamiya-ms jaybosamiya-ms deleted the jayb/fd-cleanup branch March 17, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants