PaperMC / PaperMC/Velocity

Fallback to next server when connection errors out

Open
#1,018 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: feature
Dominant language
Java
Stars
2.3k
Forks
959
Avg merge
5d 10h
Merged PRs (30d)
2

Description

I host a server for a few friends on a low-end server, sometimes the connection gets closed with the message "Connection reset by peer", but you can reconnect again.
I decided I wanted to fallback to another server when you get kicked out, which then tries to automatically connect you back, so I got a velocity plugin which does that. The plugin seems to work, I /kick myself out and it reconnects me.
However, when the connection does get reset, it still just kicks me out.
Logs:

[connected player] _Cfp has disconnected: An internal error occurred in your connection.
[connected player] _Cfp: exception encountered in com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler@3612d08e
io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer
[server connection] _Cfp -> has disconnected

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the logged com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler path for the Netty Connection reset by peer error. Compare this failure with the plugin's working /kick behavior and identify whether the connection reset reaches the fallback flow. Done means a reset connection triggers the expected automatic reconnect instead of only disconnecting the player.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.