TinyModularThings / Chunk-Pregenerator-Issue-Tracker

Issue Tracker & Wiki For Chunk Pregenerator
15 stars 0 forks source link

Server Crash during Long Pregen #44

Closed knavesmith closed 3 months ago

knavesmith commented 5 months ago

I'm setting up a heavily-modded Minecraft server for some friends. We had some lag issues related to chunk loading the last time we played modded Minecraft, so we're testing if pregenerating the world will help with the lag.

I've done a few small generation tests (each <100 chunk radius square centered on (0, 0) in various dimensions) without issues, so I'm now testing a 400 chunk radius square centered on (0, 0) in the overworld. The server has crashed 2 times so far after ~6 hours of generation, and both crashes had the same error.

Crash Report 1: crash-2024-01-16_19.12.02-server.txt Crash Report 2: crash-2024-01-16_22.19.23-server.txt

I think the crashes hung the server during closing because both crashes also had Server Watchdog forcibly close the server after 10 minutes. I'm not sure what Server Watchdog is or if it's related to Chunk Pregenerator, but I figured I'd include these reports anyways Watchdog Report 1: crash-2024-01-16_19.23.03-server.txt Watchdog Report 2: crash-2024-01-16_22.29.25-server.txt

Some other relevant info:

I'm still running the pregeneration as I post this issue, so I'll update if any more similar crashes happen.

Speiger commented 5 months ago

@knavesmith thank you for the report. The 2 crash reports (not watchdog) will be fixed in the next patch. They are actively waiting for the 1.12.2 and older ports to be finished.

Which should be rather soon.

The crash is a race condition on the Memory leak fix i am doing, which is not perfect atm. (Yes it has a random chance to crash but in future versions it shouldn't crash anymore)

^^" If everything goes wrong simply disable the memory leak protection and that crash no longer should happen.

knavesmith commented 5 months ago

Thanks for the quick reply! My friends and I don't plan on finalizing the server yet, so we'll probably wait until the next patch. I'll keep your solution in mind, though.

knavesmith commented 4 months ago

I tested this again with the new 4.4.2 version of Chunk Pregen, and it still crashes. The timings of the crashes are different this time around, but I'm guessing this is due to some fixes in the new version or because my server's modpack has changed significantly.

crash-2024-02-21_16.13.34-server.txt crash-2024-02-21_17.09.04-server.txt crash-2024-02-21_22.24.12-server.txt

I'll try disabling the memory leak fix and see how pregeneration goes.

Speiger commented 4 months ago

@knavesmith yeah looks like i need to write a true multithreading map for these things. I am lucky that i have implementations for that.

Could you pm me on discord so we can test a few things? Because at this point i need quicker feedback to test the issues if that is fine?

knavesmith commented 4 months ago

@Speiger That's fine with me.

knavesmith commented 4 months ago

Update on the test version.

The server is still crashing, but I'm no longer getting a crash report or any crash reason whatsoever.

Here is a cropped Multicraft console log for the most recent crash. (Server restart happens on Line 1995 with timestamp 22.02 05:17:04) https://mclo.gs/2KfRKuz Here is the full log, but you're not missing anything important. (Restart happens on Line 62855) server-log.txt

I don't have any logs saved from before this, but I can tell that the server had crashed at least one more time before this crash. I started a pregen task called "400rCrashTest" around 1:45 AM UTC but didn't start recording the server log until 3:30 AM UTC. The task had changed to one of my paused tasks "400rChunkGen", and the running time didn't match up with my timings. I logged in to the server to verify, and I can confirm that the "400rCrashTest" task was stopped.

Again, I'm not getting any crash reports or even a crash reason in the Multicraft console. I'll continue to leave the task running overnight, but I won't be able to record any crashes if they happen.

Speiger commented 4 months ago

@knavesmith that looks like isn't really an issue of pregen itself maybe? Dunno but that is at least a good indicator that the fix is helping since it looks like that this is a new type of issue ^^

knavesmith commented 4 months ago

Perhaps not, but I can't think of any other reason why the server would randomly crash/restart like that. There weren't any server restarts scheduled around these times, and the only people who have access to server commands are a select few friends who haven't touched the server since installing the test version of Chunk Pregenerator.

I'll continue to monitor the server and see if I can find any pregen-specific errors or crashes.

knavesmith commented 4 months ago

Does Chunk Pregenerator leave any logs when its Memory Protector gets triggered? I've noticed that my server gets pretty close to running out of memory after 2-3 hours of non-stop generation (likely because of the huge amount of mods that it's running).

Speiger commented 4 months ago

@knavesmith yeah it leaves a good amount of log saying it will restart the server.

Also in the next version this crash you have been showing me is going to be fixed. But i won't be able to fix it till the end of next week.