mojira.dev
MC-118733

Netty causing all players are kicked and prevented from join again

(I know I'm running a third party modified server, but it has been confirmed that it's not a Spigot or Bungee/Waterfall issue. And the netty library is directly from the official server software.)

Spigot suddenly throw this exception while running normally:

[10:02:13] [Netty Server IO #0/WARN]: Selector.select() returned prematurely 512 times in a row; rebuilding Selector io.netty.channel.nio.SelectedSelectionKeySetSelector@13cb56f5.
[10:02:13] [Netty Server IO #0/WARN]: Failed to re-register a Channel to the new Selector.
java.lang.ClassCastException: io.netty.channel.nio.SelectedSelectionKeySetSelector cannot be cast to java.nio.channels.spi.AbstractSelector
at java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:212) ~[?:1.8.0_131]
at io.netty.channel.nio.NioEventLoop.rebuildSelector0(NioEventLoop.java:347) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at io.netty.channel.nio.NioEventLoop.rebuildSelector(NioEventLoop.java:318) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:769) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:388) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
[10:02:13] [Netty Server IO #0/WARN]: Failed to re-register a Channel to the new Selector.
java.lang.ClassCastException: io.netty.channel.nio.SelectedSelectionKeySetSelector cannot be cast to java.nio.channels.spi.AbstractSelector
at java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:212) ~[?:1.8.0_131]
at io.netty.channel.nio.NioEventLoop.rebuildSelector0(NioEventLoop.java:347) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at io.netty.channel.nio.NioEventLoop.rebuildSelector(NioEventLoop.java:318) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:769) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:388) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [spigot-survival.jar:git-Spigot-cd6ba67-a7d074c]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
[10:02:13] [Netty Server IO #0/INFO]: Migrated 0 channel(s) to the new Selector.

Right after that all online players are kicked out immediately:

[10:02:13] [Server thread/INFO]: k_jiang lost connection: Disconnected
[10:02:13] [Server thread/INFO]: k_jiang left the game
[10:02:13] [Server thread/INFO]: Nchyns lost connection: Disconnected
[10:02:13] [Server thread/INFO]: Nchyns left the game

......(and similar messages about other players be kicked out)

Then all players are no longer be able to join the server again. No errors. This issue already happened twice today. I could only resolve this issue only by restarting the server from the console.
No other error occur on Spigot or on the Waterfall (BungeeCord) side, no matter during server start, running or shutdown.

Notice that the exception is generated on a spigot console. It makes the whole server unplayable. If this could not be resolved I have no choice but to downgrade my whole network back to 1.11.2.

The issue has never been found in 1.11.2 or older. If this is the case, then I think there is a good chance that most of servers, no matter it is the official vanilla or some third party modified, were affected. Still I also tried and still continuing to nail down this issue with the pluigns I have installed as well. Hopefully I could find something in the future.

Thank you for your consideration!

Linked issues

Comments

SunCat

it has been confirmed that it's not a Spigot or Bungee/Waterfall issue

How did you confirm it?

kjiang

https://hub.spigotmc.org/jira/browse/SPIGOT-3346
Spigot has nothing to do with netty because they did not touch it at all. And, as I said, the netty package is provided directly by the official libraries.

Just by simply google the exception you might find this interesting issue:
https://github.com/netty/netty/issues/6607

As far as I know 1.12 using netty 4.1.9. So you might need to upgrade the netty library to 4.1.10 with the official server software.

pokechu22

Duplicate of MC-118372 (which was with the vanilla server).

kjiang

(Unassigned)

Unconfirmed

Minecraft 1.12

Retrieved