mojira.dev
MC-105082

Packets sent out of order in rare cases?

In some rare cases, it seems like packets are either sent to the server out of order or recieved out of order, which doesn't seem to make any sense, given that Minecraft uses TCP for it's game connections.

We've tested this and managed to have the server receive a packet for damaging an entity on the server before it received a packet from the player closing their inventory, which given the flow of the game makes no sense - since players can't hit entities until after they close their inventory (modified clients barred here).

Based on this, the server should be receiving the inventory close packet before any packet about the player hitting an entity, however this has proven to not be the case with players with high ping/unstable connections (such as players from Australia to the US).

I'm not sure if this a large bug or just some obscure race condition, but either way, the packets shouldn't be ending up at the server in the wrong order, since that could potentially cause some eventual issues.

Linked issues

Comments 5

I wouldn't exactly say this is a packet out of order issue, but rather the client not verifying the order of events received, as I would expect closing inventory and entity damaging events are "independent" from each other, on a networking level.

Void Whisperer

The client shouldn't have to do any verification of the events recieved though - these events are happening at distinctly different enough time intervals on the client that it would strike me as very odd if they got mixed up there. When my friend who lives in Australia gets back online we are going to setup a proxy between him and the server and log the packets to see what order they are going out in.

Relates to [MC-90022] (not a duplicate though since that one is about movement packets)

Void Whisperer

That could potentially be the same thing, if the inventory close packet is sent at the update tick and the attack one is sent immediately.

Is this still an issue in the most recent versions (currently that is 1.13, or the latest snapshot 18w31a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.

Void Whisperer

(Unassigned)

Unconfirmed

Minecraft 1.10.2

Retrieved