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
Download
server.jar
Create a directory
input
Place at least one
.nbt
file ininput
Run
java -DbundlerMainClass="net.minecraft.data.Main" -jar server.jar --dev --input input
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.