Broken Pipe on Bungeecord plugin
Closed this issue · 1 comments
The error occur several time after the Spigots servers have been reboot and not immediately after the event.
Broken Pipe Error
14:29:51 [WARNING] Error dispatching event PlayerDisconnectEvent(player=viclarque) to listener fr.freebuild.playerjoingroup.bungee.listener.PlayerDisconnectListener@504243a2
java.lang.RuntimeException: java.net.SocketException: Broken pipe
at fr.freebuild.playerjoingroup.bungee.MessagesManager.lambda$sendToAll$0(MessagesManager.java:164)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at fr.freebuild.playerjoingroup.bungee.MessagesManager.lambda$sendToAll$1(MessagesManager.java:160)
at java.base/java.util.Hashtable.forEach(Hashtable.java:895)
at fr.freebuild.playerjoingroup.bungee.MessagesManager.sendToAll(MessagesManager.java:158)
at fr.freebuild.playerjoingroup.bungee.listener.ConnectionListener.broadcastEvent(ConnectionListener.java:50)
at fr.freebuild.playerjoingroup.bungee.listener.PlayerDisconnectListener.on(PlayerDisconnectListener.java:20)
at jdk.internal.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:19)
at net.md_5.bungee.event.EventBus.post(EventBus.java:49)
at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:413)
at net.md_5.bungee.connection.UpstreamBridge.disconnected(UpstreamBridge.java:68)
at net.md_5.bungee.netty.HandlerBoss.channelInactive(HandlerBoss.java:60)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:305)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:281)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:274)
at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:81)
at io.netty.handler.timeout.IdleStateHandler.channelInactive(IdleStateHandler.java:277)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:303)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:281)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:274)
at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:376)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:305)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:281)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:274)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:301)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:281)
at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901)
at io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:813)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:403)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.base/java.lang.Thread.run(Thread.java:833)
The error occur when a player is connected to the Spigot server while it's being close. The previous commit should handle the error.
If possible, the Spigot server should detect when it's about to go down and close the connection properly.