-
-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Properly check whether the so_reuseport
socket option is available
#4579
Merged
Conversation
This file contains 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
editing on mobile is hard
Camotoy
approved these changes
Apr 19, 2024
XingLingQAQ
pushed a commit
to XingLingQAQ/Geyser
that referenced
this pull request
Sep 25, 2024
…able (GeyserMC#4579) * Try to properly check if so_reuseport is available * io_uring "support" * comment out io_uring, for now * Make IO_uring opt-in via `-DGeyser.io_uring=true` flag * dont include io_uring * oops - bungee editing on mobile is hard * oops - spigot * oops - velocity * properly exclude all io_uring on all platforms except standalone --------- Co-authored-by: Kas-tle <[email protected]>
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.
Currently, whenever someone is trying to run Geyser on a system where the
so_reuseport
socket option should exist (which we guess based on the kernel version), we assume that it's fine to set the option.However, there are still cases where that's not a good indicator. In such cases, users get a warning in the console & Geyser fails to bind fully:
11:51:56 [WARNING] Unknown channel option 'io.netty.channel.unix.UnixChannelOption#SO_REUSEPORT' for channel 'org.cloudburstmc.netty.channel.raknet.RakServerChannel@38f35f8d'
This should alleviate the issue by double-checking whether the option exists once we have a bootstrap where we can get a channel from - however, i'm no netty expert and there might be other consequences I'm missing, so some testing from affected users would be great :p
This also moves the Transport check to Geyser, since we need to be able to ensure that if IO_Uring isn't enabled on Geysers side, that we fall back to e.g. epoll instead of nio. Futher, this PR adds a system property to allow Geyser to be ran with io_uring:
-DGeyser.io_uring=true
Source for channel option checking: netty/netty#13178 (comment)

After asking in the netty discord: