Skip to content

Forward plugin messages during server transitions - #1881

Closed
HP-network wants to merge 1 commit into
PaperMC:dev/4.0.0from
HP-network:fix/plugin-message-inflight
Closed

HP-network wants to merge 1 commit into
PaperMC:dev/4.0.0from
HP-network:fix/plugin-message-inflight

Conversation

@HP-network

Copy link
Copy Markdown

When switching servers, connectedServer is cleared before the new backend connection is installed. Client plugin messages received in that window were only sent to the in-flight connection for the legacy Forge handshake channel; other channels were dropped.

Use the in-flight connection whenever there is no current connected server. The existing backend state and connection-phase checks still decide whether the packet is forwarded or queued.

The regression test covers an ordinary plugin channel during the transition window.

Tests:

  • ./gradlew :velocity-proxy:test --tests com.velocitypowered.proxy.connection.client.ClientPlaySessionHandlerTest --no-daemon --console=plain
  • ./gradlew :velocity-proxy:test --no-daemon --console=plain
  • ./gradlew :velocity-proxy:check --no-daemon --console=plain

@WouterGritter

Copy link
Copy Markdown
Member

Some bookkeeping:

The differences are that #1783 also bundles an unrelated handshake hostname length change, while this PR is scoped to just the plugin-message fix and adds a regression test.

@HP-network

Copy link
Copy Markdown
Author

Thanks for checking. I agree that #1783 covers the same behavior. This PR is scoped to the plugin-message fix and includes a regression test, but I do not want to maintain a duplicate. Please keep whichever version is preferred and close this one if #1783 is the better path.

@HP-network

Copy link
Copy Markdown
Author

Closing this in favor of #1783, which covers the same plugin-message transition fix.

@HP-network HP-network closed this Sep 16, 2026
@HP-network
HP-network deleted the fix/plugin-message-inflight branch September 18, 2026 00:34
R00tB33rMan added a commit to GemstoneGG/Velocity-CTD that referenced this pull request Sep 28, 2026
Timeouts now close the side that's actually stuck, and joins, switches and reconfigurations no longer lose or misread packets.

**Fixed**
- Write timeout without a per-packet cost ([Velocity#1879](PaperMC#1879))
- Client packets right after a kick no longer disconnect the player ([Velocity#1850](PaperMC#1850))
- Plugin messages sent while joining are delivered ([Velocity#1766](PaperMC#1766), [PaperMC#1783](PaperMC#1783), [PaperMC#1881](PaperMC#1881), [Geyser#6288](GeyserMC/Geyser#6288))
- Config plugin messages and cookies reach a server that started a reconfiguration ([Velocity#1316](PaperMC#1316), [PaperMC#1459](PaperMC#1459))
- Three bugs from [CTD#1002](#1002): reconfiguration getting stuck, holds cut off by the login timeout, and silent players kept alive
- [Velocity#1873](PaperMC#1873) doesn't reproduce here, but undecoded packets are now kept during a switch too
- Fewer false read timeouts ([Velocity#1441](PaperMC#1441))

**Also**
- Backpressure pauses no longer count toward read timeouts
- Slow players are write-timed-out instead of their backends being dropped
- Async ConnectionEstablishEvent listeners no longer break logins
- Refused transfers show their message
- Backend kick reasons aren't lost while reading is paused
- Backend decoding follows the backend's real state around config switches
- Unknown config packets like reset_chat reach the player

**Not fixed:** [Velocity#1832](PaperMC#1832) (not planned), [PaperMC#1334](PaperMC#1334) and [PaperMC#1272](PaperMC#1272) (client-side).

Covered by 95 new tests, run live against Paper 26.2 and 26.3 backends, and compared against BungeeCord/Waterfall, Gate and ViaProxy.

> This has been heavily reviewed for over twelve hours, but it may still have bugs. Please report anything you find in our [issues](https://github.com/GemstoneGG/Velocity-CTD/issues).
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