Repository navigation
Index watchers by the kernel file descriptor - #21
Open
alexey-milovidov wants to merge 1 commit into
Open
alexey-milovidov wants to merge 1 commit into
alexey-milovidov wants to merge 1 commit into
Conversation
With the musl of ClickHouse, the file descriptors visible to the program are a pseudorandom 31-bit encoding of the kernel descriptor and its generation (see `contrib/musl/src/internal/fdmap.h` in ClickHouse), so `loop->watchers[fd]` would need an array of gigabytes. The table is now indexed by the kernel descriptor, which is small. A watcher whose descriptor is already closed is found by a search, and an epoll event of a descriptor that does not match the watcher (closed and reused) is disarmed like an event of a stopped watcher. The kernel reads the descriptors of io_uring submission entries directly, so they are translated too, and the result of an `openat` through io_uring is converted back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
With the musl of ClickHouse, the file descriptors visible to the program are a pseudorandom 31-bit encoding of the kernel descriptor and its generation, so
loop->watchers[fd]would need an array of gigabytes (RabbitMQ and NATS use libuv).uv__kernel_fd, identity withoutUSE_MUSL).openatthrough io_uring is converted back.Related: ClickHouse/musl#22
🤖 Generated with Claude Code