mojira.dev
MC-302816

When running NBT to SNBT conversion, the program waits for 1 minute after completion

When the server.jar is used to run data generators and NBT to SNBT conversion is performed, the conversion first works as expected. However, instead of exiting immediately when it is finished, the program waits for about a minute. This is similar to MC-131739.

Steps to reproduce

  1. Download server.jar

  2. Create a directory input

  3. Place at least one .nbt file in input

  4. Run java -DbundlerMainClass="net.minecraft.data.Main" -jar server.jar --dev --input input

  5. Observe that the conversion completes within seconds and stores the SNBT files in ./generated/, but the program does not exit until 1 minute later

Code analysis

This issue started occurring in 1.20.3-pre1 and the reason appears to be that net.minecraft.Util.IO_POOL was changed to use non-daemon threads. In addition, when net.minecraft.data.Main is used as the main class, nothing calls net.minecraft.Util.shutdownExecutors() to initiate a shutdown of IO_POOL, meaning the program needs to wait for a timeout.

Environment

Arch Linux

Comments 0

No comments.

28500605

boq

Confirmed

Platform

Low

(Unassigned)

1.21.10, 25w41a

25w42a

Retrieved