FrozenBlock / FrozenLib

Library mod for FrozenBlock's mods
GNU General Public License v3.0
8 stars 5 forks source link

Chunk generation deadlock #35

Closed 2No2Name closed 2 weeks ago

2No2Name commented 9 months ago

This line seems to cause the chunk generation to deadlock. However, lithium is also in that stacktrace, so we are not sure whether it is really only caused by your mod.

https://github.com/FrozenBlock/FrozenLib/blob/29e4e68692855b8d5a43348892771b27fc316503/src/main/java/net/frozenblock/lib/worldgen/feature/api/features/FadingDiskTagFeature.java#L116

Crash report: https://mclo.gs/e5zFnhU

(First reported to https://github.com/CaffeineMC/lithium-fabric/issues/493)

AViewFromTheTop commented 9 months ago

Odd. I play with Lithium and I haven’t had this happen since I switched that line to the blocking version. Using the other execute method results in this issue, however.

2No2Name commented 9 months ago

Maybe I misattributed it, which other methods do you mean?

AViewFromTheTop commented 9 months ago

Maybe I misattributed it, which other methods do you mean?

There’s a .execute and a .executeBlocking method, and as far as I’m aware the blocking variant solves that issue. There’s always a chance it doesn’t for everyone, but I’ve genuinely never had this happen in my months of playing- even alongside Lithium which I always use on my server.

Bawnorton commented 3 weeks ago

I think I've gotten to the bottom of the cause of this.

Using modernfix's thread dump you can see that frozenlib's FadingDiskTagFeature is parked in the chunk gen thread "Worker-Main-5" Full thread dump: https://mclo.gs/TDU0TQ7

So I wrote a small mixin to just skip the disk generation (cancellable inject at head of place (moj)/generate (yarn)) and re-opened the same world where the deadlock happened initially and it did not hang or deadlock.

Some notes:

  1. I found this deadlock while looking for something that generates in desert village chests from mythic metals, I initially believed it to be the cause, it was not.
  2. The crash seems to only occur at desert villages, not the general terrain, I don't know why.
  3. Placing any feature from wilder wild normally through commands or the individual blueprints of the desert village houses works fine, this only seems to happen during world gen.
  4. I verified that the deadlock happens with only wilder wild and frozen lib present while generating a desert village, no lithium or other optimisation mods present
AViewFromTheTop commented 3 weeks ago

Rip

AViewFromTheTop commented 3 weeks ago

If anyone knows how to generate features similarly to structures (it saves, and generates per-chunk instead of generating all at once) that would be awesome and solve the issue completely

AViewFromTheTop commented 3 weeks ago

@Treetrain1 maybe you could try doing this

AViewFromTheTop commented 2 weeks ago

Fixed by simply removing this, and limiting features to a max radius of 15.