[SPIGOT-854] Disconnect is called twice on idle kick Created: 02/May/15  Updated: 20/Jan/21  Resolved: 20/Jan/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: RingOfStorms Assignee: Unassigned
Resolution: Fixed Votes: 3
Labels: None
Environment:

Java 8



 Description   

If you enable the player-idle-timeout setting in the server.properties by setting it greater to 0 (in minutes) it will kick the player, but it will also send a warning in console saying that the disconnection method was called twice.

Log:
[16:42:07 INFO]: RingOfStorms lost connection: You have been idle for too long!
[16:42:07 WARN]: handleDisconnection() called twice
>version
[16:42:16 INFO]: This server is running CraftBukkit version git-Spigot-2ec6f06-7722428 (MC: 1.8.3) (Implementing API version 1.8.3-R0.1-SNAPSHOT)
[16:42:16 INFO]: Checking version, please wait...
[16:42:18 INFO]: You are running the latest version

server.properties:
player-idle-timeout=1



 Comments   
Comment by md_5 [ 20/Jan/21 ]

Not an issue on 1.16.5

Comment by Joel Paulien [ 21/Sep/16 ]

This is still not fixed. I have some simple proof-of-concept code to re-create it:

    @EventHandler (priority = EventPriority.LOW)
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        player.kickPlayer("Sucks for you!");
    }

Here's a picture of the server log: http://i.imgur.com/aB02SeQ.png

Comment by Hex [ 16/Nov/15 ]

Re-opened as it seems that it was never actually fixed.

Comment by BillyGalbreath [ 15/Nov/15 ]

This is not fixed. More bug reports are being made that duplicate this.

https://hub.spigotmc.org/jira/browse/SPIGOT-1133

I still receive this warning message when using the player.kickPlayer() api method on version git-Spigot-5f38d38-18fbb24 (MC: 1.8.8).

Here is a forum thread about it show how often this is happening to people: https://www.spigotmc.org/threads/handledisconnect-called-twice.74171/

Comment by Kit Manners [ 29/Jul/15 ]

This is still happening for me when I use player.kickPlayer(string) - the PlayerKickEvent is only fired once though.

>ver
[12:05:50 INFO]: This server is running CraftBukkit version git-Spigot-6c9b0a1-de5c261 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)
[12:05:50 INFO]: Checking version, please wait...
[12:05:52 INFO]: You are running the latest version
[12:06:06 INFO]: gigosaurus issued server command: /stop
[12:06:06 INFO]: Server is restarting!
[12:06:11 INFO]: gigosaurus lost connection: Server restarting!
[12:06:11 WARN]: handleDisconnection() called twice
[12:06:11 INFO]: Stopping server

Comment by Nicolas Glassey [ 04/May/15 ]

Same issue, that has been there at least since the first 1.8 spigot.

Happens for every player kick (timeout, plugin called, spam-related, ...).

[13:19:20 INFO]: UUID of player Weby is f057c938-0813-454f-aa52-db0e7d7d17bb
[13:19:20 INFO]: Weby joined the server while vanished !
[13:19:20 INFO]: Weby[/178.197.233.28:15301] logged in with entity id 515518 at ([Builders]1986.272304079097, 65.37963517855191, -586.9771343665187)
[13:19:22 INFO]: Weby issued server command: /we cui
[13:19:22 INFO]: WorldEdit: Weby (in "Builders"): cui
save-all
[13:19:31 INFO]: Saving...
[13:19:31 INFO]: Saved the world
kick Weby
[13:19:33 INFO]: §b§k|||§r§e§l Police §r§c§k|||§r §r§7§oSee, kids ? The kick that happened to Weby could happen to you too, if you don't behave !
[13:19:33 INFO]: Weby lost connection: §b§k|||§r§e§l Police §r§c§k|||§r §r§7§oYou were kicked. I think you did something bad. §b§k|||§r§e§l Police §r§c§k|||§r §r§7§o
[13:19:33 INFO]: Weby left the server, and was vanished !
[13:19:33 WARN]: handleDisconnection() called twice

Generated at Sat Dec 13 13:42:54 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.