Skip to content
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
merged 13 commits into from
Apr 19, 2024

Conversation

onebeastchris
Copy link
Member

@onebeastchris onebeastchris commented Apr 17, 2024

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:
image

@onebeastchris onebeastchris added PR: Needs Testing When a PR needs testing but is currently not under review PR: Bugfix When a PR contains a bugfix labels Apr 17, 2024
@onebeastchris onebeastchris removed the PR: Needs Testing When a PR needs testing but is currently not under review label Apr 18, 2024
@onebeastchris onebeastchris merged commit 94f664a into GeyserMC:master Apr 19, 2024
1 check passed
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
Labels
PR: Bugfix When a PR contains a bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants