Skip to content

Resolve race condition when injecting floodgate handler#651

Merged
Tim203 merged 1 commit intomasterfrom
fix/spigot-injection
Feb 26, 2026
Merged

Resolve race condition when injecting floodgate handler#651
Tim203 merged 1 commit intomasterfrom
fix/spigot-injection

Conversation

@onebeastchris
Copy link
Copy Markdown
Member

This should resolve a long-standing issue where floodgate-spigot was "late" to the party, especially when used alongside Geyser-Spigot.

Initial debugging (see this gist ) shows a case where netty fired channelActive before Floodgate finished its injection process.

With Geyser's use-direct-connection feature, MCPL receives this channelActive call, which resulted in MCPL firing a ConnectedEvent), which in turn is used by the ClientListener to start the auth process by sending a packet that floodgate is supposed to intercept. However, Floodgate wasn't able to due to the injection not being completed in some occurrences at that time.

Here is a log showing which events are fired with this patch. I've tested it locally and am no longer able to reproduce the issue with this patch - without it, it occurred about once every 4-5 joins.

Resolves #530,
Resolves GeyserMC/Geyser#5086,
Resolves GeyserMC/Geyser#5828,
Resolves GeyserMC/Geyser#5975,
Resolves GeyserMC/Geyser#4403,
likely also #598

@onebeastchris
Copy link
Copy Markdown
Member Author

Tested on Paper 1.21.11, 1.16.5, and also 1.8.9 + Geyser-Standalone; seems to work fine. Will merge on Thursday if no further issues will be reported by other testers

@Tim203 Tim203 merged commit a09f3ee into master Feb 26, 2026
2 checks passed
@onebeastchris onebeastchris deleted the fix/spigot-injection branch February 26, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment