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

ProjectStore.initIfNecessary has a tiny risk of losing data #55

Open
WULCAN opened this issue Mar 14, 2024 · 0 comments
Open

ProjectStore.initIfNecessary has a tiny risk of losing data #55

WULCAN opened this issue Mar 14, 2024 · 0 comments

Comments

@WULCAN
Copy link
Collaborator

WULCAN commented Mar 14, 2024

On e5d3297, ProjectStore.initIfNecessary implements lazy-initialization of languages. While we await getTranslations, other invocations can enter initIfNecessary. As we are still waiting, the new invocations will find languages empty and start their own initialization.

Concurrent getTranslations are non-problematic but overwriting languages is worse. If getTranslation was very slow, translators might already have made changes to languages before the last initializing invocation writes languages. Then those changes will be lost.

As long as getTranslations is not extremely slow, the risk of losing work like this remains very low.

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

1 participant