mojira.dev
MC-234733

Closing game during world loading screen causes errors

The bug

When closing the game while loading a world, an error (java.util.concurrent.RejectedExecutionException: null) occurs. This is similar to MC-187583. The exception message thrown is "Cound not schedule mailbox" (sic). A crash has occurred once, but a crash report was not produced.

Example 1.17.1 log (abridged)

[13:49:54] [Render thread/INFO]: Preparing spawn area: 0%
[13:49:55] [Render thread/INFO]: Preparing spawn area: 0%
[13:49:55] [Render thread/INFO]: Preparing spawn area: 1%
(...)
[13:50:09] [Render thread/INFO]: Preparing spawn area: 89%
[13:50:09] [Render thread/INFO]: Time elapsed: 15197 ms
[13:50:10] [Render thread/INFO]: Stopping!
[13:50:10] [Server thread/ERROR]: Cound not schedule mailbox
java.util.concurrent.RejectedExecutionException: null
	at java.util.concurrent.ForkJoinPool.externalPush(ForkJoinPool.java:1889) ~[?:?]
	at java.util.concurrent.ForkJoinPool.externalSubmit(ForkJoinPool.java:1930) ~[?:?]
	at java.util.concurrent.ForkJoinPool.execute(ForkJoinPool.java:2462) ~[?:?]
	at aqy.h(SourceFile:135) ~[1.17.1.jar:?]
	at aqy.a(SourceFile:124) ~[1.17.1.jar:?]
	at abg.a(SourceFile:125) ~[1.17.1.jar:?]
	at abg.a(SourceFile:91) ~[1.17.1.jar:?]
	at aqx$1.a(SourceFile:44) ~[1.17.1.jar:?]
	at abu.a(SourceFile:104) ~[1.17.1.jar:?]
	at abu.a(SourceFile:100) ~[1.17.1.jar:?]
	at abu.a(SourceFile:61) ~[1.17.1.jar:?]
	at bwq.a(SourceFile:220) ~[1.17.1.jar:?]
	at bwq.a(SourceFile:196) ~[1.17.1.jar:?]
	at deq.a(SourceFile:261) ~[1.17.1.jar:?]
	at deq.a(SourceFile:160) ~[1.17.1.jar:?]
	at deq.a(SourceFile:140) ~[1.17.1.jar:?]
	at deq.a(SourceFile:458) ~[1.17.1.jar:?]
	at des.a(SourceFile:76) ~[1.17.1.jar:?]
	at abr.a(SourceFile:637) ~[1.17.1.jar:?]
	at bxf.b(SourceFile:81) ~[1.17.1.jar:?]
	at abr.a(SourceFile:365) ~[1.17.1.jar:?]
	at net.minecraft.server.MinecraftServer.b(SourceFile:891) ~[1.17.1.jar:?]
	at net.minecraft.server.MinecraftServer.a(SourceFile:831) ~[1.17.1.jar:?]
	at faq.a(SourceFile:96) ~[1.17.1.jar:?]
	at net.minecraft.server.MinecraftServer.x(SourceFile:697) ~[1.17.1.jar:?]
	at net.minecraft.server.MinecraftServer.a(SourceFile:270) ~[1.17.1.jar:?]
	at java.lang.Thread.run(Thread.java:831) [?:?]

Example 24w10a log (abridged)

(...)
[19:01:13] [Render thread/INFO]: Preparing spawn area: 0%
[19:01:13] [Render thread/INFO]: Preparing spawn area: 0%
[19:01:13] [Render thread/INFO]: Preparing spawn area: 0%
[19:01:14] [Server thread/INFO]: Changing view distance to 9, from 10
[19:01:14] [Server thread/INFO]: Changing simulation distance to 5, from 0
[19:01:14] [Render thread/INFO]: Time elapsed: 1347 ms
[19:01:14] [Render thread/INFO]: Stopping!
[19:01:14] [IO-Worker-13/ERROR]: Cound not schedule mailbox
java.util.concurrent.RejectedExecutionException: Task IOWorker-chunk 2 false rejected from java.util.concurrent.ThreadPoolExecutor@4944508b[Shutting down, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 15302]
	at java.base/java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2065) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:833) ~[?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1365) ~[?:?]
	at bmy.i(SourceFile:135) [24w10a.jar:?]
	at bmy.run(SourceFile:105) [24w10a.jar:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.base/java.lang.Thread.run(Thread.java:833) [?:?]
[19:01:14] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 1037193137ms or 20743862 ticks behind

How to reproduce

1. Start the game and load a world.

2. While the world loading screen is shown, close the window by pressing the X button.
3. Look at the log.

Note: The game window might not close immediately after the X button of the window has been pressed, but it closes as soon as loading has (nearly) finished.
Look at the log file after the window has closed.

Linked issues

Attachments

Comments 2

Thanks for creating the report! On Windows 10 for me the game also does not immediately close the game window when the X is pressed, but only once loading has (nearly) finished. I don't know if Linux or MacOS behave the same way.
I have added this to the reproduction steps to prevent any confusion.

Can confirm for 22w14a on Windows 10.

[media]

ampolive

(Unassigned)

Confirmed

Platform

Low

Chunk loading

1.17.1, 21w37a, 21w38a, 21w39a, 21w40a, ..., 1.20.1, 1.20.2, 1.20.4, 24w10a, 1.21

Retrieved