ProxioDev / ValioBungee

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

RedisBungee disables first before other plugins that depends on it in Velocity #71

Closed kit8379 closed 1 year ago

kit8379 commented 1 year ago

Describe the bug Here is a bug report that related TAB plugin with RedisBungee (Velocity) implementation. The TAB plugin hooked into RedisBungee correctly and there is a issue occur after using multiple proxies:

"A issue when connecting to a server in a separate group from an isolated group server. The tab list displays correctly even if the server doesn't have the particular player. However, when switching to servers within the same group, the tab list only shows local players. To correct this, one must reconnect to an isolated group server and then reconnect back to the server in that group. Hopefully, this information can assist those facing similar problems."

We found out that the issue may related to error cause by RedisBungee. There is a related RedisBungee error occur during the server shutdown.

To Reproduce Steps to reproduce the behavior:

  1. Start Velocity with RedisBungee
  2. Stop Velocity with /end
  3. You can see this error in console

Expected behavior You can see this error in console

Screenshots

Redis version? it should be at least 6 and above. 7.0.8

Bungeecord version or (the bungee fork name eg: waterfall) and your plugins Velocity 3.2.0-SNAPSHOT (git-dc7efd93-b237)

console logs? 23.04.2023 - 17:53:50 - [TAB v4.0.0-SNAPSHOT] Failed to disable 23.04.2023 - 17:53:50 - java.net.SocketException: Socket closed 23.04.2023 - 17:53:50 - at java.base/sun.nio.ch.NioSocketImpl.ensureOpenAndConnected(NioSocketImpl.java:165) 23.04.2023 - 17:53:50 - at java.base/sun.nio.ch.NioSocketImpl.beginWrite(NioSocketImpl.java:366) 23.04.2023 - 17:53:50 - at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:411) 23.04.2023 - 17:53:50 - at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440) 23.04.2023 - 17:53:50 - at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826) 23.04.2023 - 17:53:50 - at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1035) 23.04.2023 - 17:53:50 - at com.imaginarycode.minecraft.redisbungee.internal.jedis.util.RedisOutputStream.flushBuffer(RedisOutputStream.java:57) 23.04.2023 - 17:53:50 - at com.imaginarycode.minecraft.redisbungee.internal.jedis.util.RedisOutputStream.flush(RedisOutputStream.java:138) 23.04.2023 - 17:53:50 - at com.imaginarycode.minecraft.redisbungee.internal.jedis.Connection.flush(Connection.java:303) 23.04.2023 - 17:53:50 - at com.imaginarycode.minecraft.redisbungee.internal.jedis.JedisPubSub.unsubscribe(JedisPubSub.java:54) 23.04.2023 - 17:53:50 - at com.imaginarycode.minecraft.redisbungee.api.PubSubListener.removeChannel(PubSubListener.java:63) 23.04.2023 - 17:53:50 - at com.imaginarycode.minecraft.redisbungee.AbstractRedisBungeeAPI.unregisterPubSubChannels(AbstractRedisBungeeAPI.java:285) 23.04.2023 - 17:53:50 - at me.neznamy.tab.platforms.velocity.features.VelocityRedisSupport.unregister(VelocityRedisSupport.java:38) 23.04.2023 - 17:53:50 - at me.neznamy.tab.shared.features.redis.RedisSupport.unload(RedisSupport.java:353) 23.04.2023 - 17:53:50 - at me.neznamy.tab.shared.FeatureManager.unload(FeatureManager.java:54) 23.04.2023 - 17:53:50 - at me.neznamy.tab.shared.TAB.unload(TAB.java:193) 23.04.2023 - 17:53:50 - at me.neznamy.tab.platforms.velocity.VelocityTAB.onProxyShutdown(VelocityTAB.java:91) 23.04.2023 - 17:53:50 - at me.neznamy.tab.platforms.velocity.Lmbda$33.execute(Unknown Source) 23.04.2023 - 17:53:50 - at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) 23.04.2023 - 17:53:50 - at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) 23.04.2023 - 17:53:50 - at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) 23.04.2023 - 17:53:50 - at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) 23.04.2023 - 17:53:50 - at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) 23.04.2023 - 17:53:50 - at java.base/java.lang.Thread.run(Thread.java:833)

ham1255 commented 1 year ago

werid i thought TAB plugin does not have redisbungee Velocity support based on this line from TAB's code https://github.com/NEZNAMY/TAB/blob/51635a7322029ed3ffb4ea2eab768e1c1dd16dca/velocity/src/main/java/me/neznamy/tab/platforms/velocity/VelocityTAB.java#L75

nvm found the v4 branch

ham1255 commented 1 year ago

it seems like Velocity disables RedisBungee first which closes the connection pool hence closed socket error.

ham1255 commented 1 year ago

i need full logs please if you are able too.

ham1255 commented 1 year ago

okay seems like that the case RedisBungee get disabled first before tab plugin does