ProxioDev / ValioBungee

Synchronize players data between BungeeCord / Velocity proxies
Eclipse Public License 1.0
191 stars 50 forks source link

IllegalStateException when leaving servers using the RedisBungee PAPI Expansion #99

Closed md5nake closed 2 months ago

md5nake commented 2 months ago

intended behavior

I expect RedisBungee to gracefully handle IllegalStateExceptions thrown when responding to a plugin message, but there are no players connected to the querying server.

what the behavior you actually saw

Exception in task com.imaginarycode.minecraft.redisbungee.RedisBungeeListener$$Lambda/0x00007f2a08d096e8@bc7587a by plugin RedisBungee
java.lang.IllegalStateException: Not connected to server!
        at com.velocitypowered.proxy.connection.backend.VelocityServerConnection.ensureConnected(VelocityServerConnection.java:220) ~[velocity-3.3.0-SNAPSHOT-390.jar:3.3.0-SNAPSHOT (git-afd8b55f-b390)]
        at com.velocitypowered.proxy.connection.backend.VelocityServerConnection.sendPluginMessage(VelocityServerConnection.java:299) ~[velocity-3.3.0-SNAPSHOT-390.jar:3.3.0-SNAPSHOT (git-afd8b55f-b390)]
        at com.velocitypowered.proxy.connection.backend.VelocityServerConnection.sendPluginMessage(VelocityServerConnection.java:267) ~[velocity-3.3.0-SNAPSHOT-390.jar:3.3.0-SNAPSHOT (git-afd8b55f-b390)]
        at com.imaginarycode.minecraft.redisbungee.RedisBungeeListener.lambda$onPluginMessage$1(RedisBungeeListener.java:150) ~[?:?]
        at com.velocitypowered.proxy.scheduler.VelocityScheduler$VelocityTask.lambda$run$0(VelocityScheduler.java:285) ~[velocity-3.3.0-SNAPSHOT-390.jar:3.3.0-SNAPSHOT (git-afd8b55f-b390)]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
        at java.base/java.lang.Thread.run(Unknown Source) [?:?]

Steps to reproduce

Have a server querying the proxy using The RedisBungee PAPI Expansion, then kick all players from it during transmission.

Velocity or Bungeecord Versions

Velocity 3.3.0

RedisBungee Version & Redis Version

RedisBungee Version: 0.12.3-SNAPSHOT1 (71287055b48486e63a560f93ba525350e41e9e45)

Other

No response

ham1255 commented 2 months ago

this funny, i don't see IllegalStateException mentioned in javadocs of ServerConnection#sendPluginMessage

ham1255 commented 2 months ago

published a fix https://github.com/ProxioDev/ValioBungee/actions/runs/9081986083