Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-154303

Server can freeze for several minutes (when recalculating light levels?)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.14.4
    • Minecraft 1.14.2, Minecraft 1.14.3 Pre-Release 2
    • None
    • Unconfirmed
    • (Unassigned)

      I created a quick little data pack that creates a perimeter reasonably quickly. It clears out a 289x289 area around the player from Y 255 to Y 0, removing one layer every tick from the top of the world going downwards. This, while obviously creating a lot of lag while it's clearing blocks, in itself runs fine.

      The issue occurs once it's done clearing the area. At some point shortly after the area is cleared the server completely freezes for several minutes. The /debug command doesn't show what's going on (as far as I can tell). When it finally unfreezes all light levels in the area where blocks were removed seem to have been recalculated as they are now correct, where as before the light levels were still the same as before any blocks were removed in the area.

      I'm not sure why it doesn't recalculate light levels on the fly while blocks are being cleared out, but regardless, recalculating light levels seems to take an abnormally long time to finish. I would expect it to cause a big lag spike, but not a complete server freeze for 4 - 5 minutes (on my system).

      It seems like this doesn't always happen for some reason (needs more testing). and the the time it takes for it to occur after all blocks have been cleared is fairly random. Sometimes it only takes a few seconds, other times it takes several minutes.

      A debug output and the data pack are attached.

      Also, here is a (very boring) video demonstrating the issue: https://www.youtube.com/watch?v=k36lSDuDTGM
      At 1:22 the data pack is done clearing out all blocks.
      At 3:02 the server suddenly freezes completely.
      At 8:48 the server is no longer frozen. At this point you can see that the previous tick took over 5 minutes.
      I stopped recording at this point, but once I flew back into the perimeter all light levels updated to what they should be.

      To use the data pack simply type "/trigger MakePerimeter". Make sure your render distance is set to at least 9 if you plan on using the data pack, and don't move too far away from the position you were originally at in order to keep the chunks loaded.

      To summarize:
      -Light levels are not being updated on the go when clearing out a large amount of blocks at once.
      -At some point the server freezes completely for serveral minutes, during which it looks like light levels are being recalculated.
      -The above takes (what seems like) an abnormally long time.

            Unassigned Unassigned
            VeilStar VeilStar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: