Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunk generation deadlock #35

Closed
2No2Name opened this issue Nov 23, 2023 · 8 comments
Closed

Chunk generation deadlock #35

2No2Name opened this issue Nov 23, 2023 · 8 comments

Comments

@2No2Name
Copy link

2No2Name commented Nov 23, 2023

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.

serverLevel.getServer().executeBlocking(() -> consumer.accept(serverLevel));

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

(First reported to CaffeineMC/lithium-fabric#493)

@AViewFromTheTop
Copy link
Member

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
Copy link
Author

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

@AViewFromTheTop
Copy link
Member

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
Copy link

Bawnorton commented Aug 16, 2024

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
Copy link
Member

Rip

@AViewFromTheTop
Copy link
Member

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
Copy link
Member

@Treetrain1 maybe you could try doing this

@AViewFromTheTop
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants