unix address support is half arsed
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Stack trace
https://paste.gg/p/anonymous/22ef4f7a69cb4276a77dd4aa569f5420
Plugin and Datapack List
no
Actions to reproduce (if known)
- use a unix address in the server-ip setting in server.properties such as
unix:/tmp/paper-server.sock - enable velocity/bungeecord in various configs
- patch velocity/bungeecord to allow for proper unix address support between the server and the proxy
- add the server's unix address to the proxy's server list
- start both the server and the proxy
- (if ping passthrough is enabled on the proxy) pinging the proxy will cause the big stacktrace to be shown, the ping will fail
- attempting to connect will fail and the small stacktrace will be shown
Paper version
This server is running Paper version git-Paper-280 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 4675152)
Other
patches/server/0602-Add-Unix-domain-socket-support.patch adds support for unix addresses between the proxy and the server, but the server still performs unconditional casts to InetSocketAddress pointed out in the stacktraces (and maybe some other places). Fixing these should be trivial.
More problematically, NetworkClient.getAddress() has a return type of @NotNull InetSocketAddress and so the PaperNetworkClient unconditionally casts the address, moreover Player.getAddress() is @Nullable and returns null when the address is not an InetSocketAddress, this is an API break. Either the annotation on NetworkClient has to be changed or some exception-being-thrown-behaviour has to be specified and CraftPlayer.getAddress need follow. Either case is API break.
Alternatively, drop the patch adding support for unix addresses, but that would make me very sad.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with patches/server/0602-Add-Unix-domain-socket-support.patch and the linked stack traces, then inspect NetworkClient.getAddress(), PaperNetworkClient, and CraftPlayer.getAddress(). Determine the intended API behavior for Unix addresses, then verify proxy ping passthrough and connection attempts no longer fail without invalid casts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100