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

[1.16.5] Nightconfig can encounter file already opened exception #145

Open
Kaleidio opened this issue Dec 11, 2022 · 5 comments
Open

[1.16.5] Nightconfig can encounter file already opened exception #145

Kaleidio opened this issue Dec 11, 2022 · 5 comments

Comments

@Kaleidio
Copy link

Kaleidio commented Dec 11, 2022

Versions (Be specific, do not write "latest"):

  • Champions: 1.16.5-2.0.1.15
  • Forge: 1.16.5-36.2.39

Observed Behavior:

This issue only began to happen after the latest update. Due to the high speed of processing, it is a rare lockup that causes the client to freeze and requires manual shutdown from task manager.

This seems to be an issue with the multithreaded behaviour of nightconfig.

For whatever reason Nightconfig will attempt to read the serverconfig file on a separate thread whilst it is also writing the new values if a config file is in the defaultconfigs folder on a thread that has the file still locked. Are you relying on a custom config system hooked into nightconfig or is this a forge issue I should submit?

Expected Behavior:

Don't open the serverconfig version of the file twice at once when loading a config provided in the defaultconfigs folder.

Steps to Reproduce:

  1. install mod and create a defaultconfig
  2. set defaultconfig to something "not correct" (aka not default) and let forge attempt to load it
  3. reload game and create worlds until the crash occurs (is rare, and random)

Crash Log:
(the game does not crash, only freeze. below is the snippet of the log past the point of error.)
https://pastebin.com/69e6TVDp

@Kaleidio Kaleidio changed the title [1.16.5] Nightconfig can thread race config loading and encounter file already opened exception [1.16.5] Nightconfig can encounter file already opened exception Dec 11, 2022
@Kaleidio
Copy link
Author

Noted as possible conflict with Knightfall! (mod adds behaviour where mobs will take higher fall damage with higher armor tiers), but cannot confirm

@TheIllusiveC4
Copy link
Owner

It seems to be a Forge issue as it happens with other mods as well: MinecraftForge/MinecraftForge#7963

@Kaleidio
Copy link
Author

understood, closing issue due to irrelevancy

@Kaleidio
Copy link
Author

Kaleidio commented Feb 12, 2023

Reopening issue as I can only ever get it to reproduce specifically with Champions. the config code of this mod should be inspected to make sure a thread race cannot occur, via some sort of workaround. I will research a possible solution when available.

@Kaleidio Kaleidio reopened this Feb 12, 2023
@TheIllusiveC4
Copy link
Owner

I've already made efforts to ensure against race conditions, at least as much as I am aware of.

The issue is that the logs you've provided show that the logic is failing from Forge and NightConfig's end, which I'm not capable of controlling as I'm purely a consumer of their configuration API and I don't edit the way they load configuration values. As linked in the issue thread above, many other mods are encountering this issue without Champions involved so I don't believe this is related to Champions specifically.

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

2 participants