Skip to content

unix address support is half arsed #9923

@emilyy-dev

Description

@emilyy-dev

Stack trace

https://paste.gg/p/anonymous/22ef4f7a69cb4276a77dd4aa569f5420

Plugin and Datapack List

no

Actions to reproduce (if known)

  1. use a unix address in the server-ip setting in server.properties such as unix:/tmp/paper-server.sock
  2. enable velocity/bungeecord in various configs
  3. patch velocity/bungeecord to allow for proper unix address support between the server and the proxy
  4. add the server's unix address to the proxy's server list
  5. start both the server and the proxy
  6. (if ping passthrough is enabled on the proxy) pinging the proxy will cause the big stacktrace to be shown, the ping will fail
  7. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: bugSomething doesn't work as it was intended to.

    Type

    No fields configured for Bug.

    Projects

    Status

    ✅ Accepted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions