GlowstoneMC / Glowstone-Legacy

An open-source server for the Bukkit Minecraft modding interface
Other
363 stars 122 forks source link

Commands that block the main loop are not executed in order #575

Open dequis opened 9 years ago

dequis commented 9 years ago

I did a series of commands like /tp 5000 100 5000 increasing the Z coordinate by 1000 each time, very quickly. Since that requires a bunch of worldgen, that blocks the main loop. The problem is that some of those commands are executed as soon as they are received, resulting in this:

03:08:24 [INFO] dequis issued command: /tp 5000 100 5000
03:08:35 [INFO] dequis issued command: /tp 5000 100 6000
03:08:40 [INFO] dequis issued command: /tp 5000 100 8000
03:08:40 [INFO] dequis issued command: /tp 5000 100 7000
03:08:40 [INFO] dequis issued command: /tp 5000 100 9000
03:08:45 [INFO] dequis issued command: /tp 5000 100 12000
03:08:45 [INFO] dequis issued command: /tp 5000 100 11000
03:08:45 [INFO] dequis issued command: /tp 5000 100 10000
03:08:51 [INFO] dequis issued command: /tp 5000 100 15000
03:08:51 [INFO] dequis issued command: /tp 5000 100 13000
03:08:51 [INFO] dequis issued command: /tp 5000 100 14000
03:08:56 [INFO] dequis kicked: Timed out

(command replies omitted for clarity)

In case that doesn't look obvious enough, it should be:

5000 -> 6000 -> 7000 -> 8000 -> 9000 -> 10000 -> 11000 -> 12000 -> 13000 -> 14000 -> 15000

And is:

5000 -> 6000 -> 8000 -> 7000 -> 9000 -> 12000 -> 11000 -> 10000 -> 15000 -> 14000 -> 13000

turt2live commented 9 years ago

Another interesting point is the timestamps. The server seems to be handling 3-6 commands every 5-10 seconds (both statistics approximate).

gdude2002 commented 9 years ago

Oh, that's pretty interesting. Maybe there's some command threading going on?

JMinecraftF commented 9 years ago

This is a good one cool good