Mojira Archive
MC-164281

Lighting thread and gameplay thread can desync

The bug

In a previous version the lighting engine was moved to a separate thread. However it appears there is nothing which prevents desync between the gameplay and the lighting thread.

This can cause all kind of unexpected behavior, for example:

  • Being unable to plant crops in lit up caves
  • Monters spawning in lit up areas
  • Stopping the server / closing a world when the lighting thread has not caught up causes pending light updates to get lost

How to reproduce

  1. Place a repeating command block (always active), pointing upwards
    fill ~ 255 ~ ~20 255 ~20 stone
    
  2. Place a chain command block above (always active)
    fill ~ 255 ~ ~20 255 ~20 air
    
  3. Set the time to night
    /time set night
    
  4. Open the debug screen (F3)
  5. Place a light source, e.g. a torch
    The "block" value for "Server light" does not change
  6. Reopen the world
    The area around the light source is not lit up

Awaiting Response

Marcono1234

2019-10-22, 02:52 AM

2023-07-04, 04:05 PM

2023-07-04, 04:05 PM

28

12

Confirmed

Normal

Lighting

19w42a - 21w40a19w42a, 1.15.2, 20w15a, 1.16.2, 20w51a, 21w40a

-