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

Improve data resiliency of PersistentState #3942

Open
raoulvdberge opened this issue Jul 14, 2024 · 1 comment
Open

Improve data resiliency of PersistentState #3942

raoulvdberge opened this issue Jul 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@raoulvdberge
Copy link

Currently, PersistentState is not safe to use because if a crash/unexpected power loss happens and there's a large PersistentState that takes a large amount of time to write to disk, it could end up only being partially written and then fail to deserialize on startup.

This has been fixed in NeoForge via following PR: neoforged/NeoForge#1001

Refined Storage is currently having following PersistentState implementation as a stop-gap solution: https://github.com/refinedmods/refinedstorage2/blob/develop/refinedstorage-platform-common/src/main/java/com/refinedmods/refinedstorage/platform/common/support/AbstractSafeSavedData.java

@modmuss50
Copy link
Member

As discussed if we make this change it should only apply to mods, and not effect the vanilla states. How we actually determine this is not super clear to me though.

@modmuss50 modmuss50 added the enhancement New feature or request label Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants