SpigotMC/Spigot — pull request #155 by yawkat (2014-04-25 21:50:54+00:00)
Title: Fix race condition that could kill connections before they were initiated

Copied from the commit description:

Because NetworkManagers are registered before they get their channel in channelActive, the ServerConnection would remove them sometimes because it thought they were disconnected. This commit fixes this by introducing a 'preparing' variable that is true while the NetworkManager is not initialized. The ServerConnection does not remove NetworkManagers with this flag.