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

config: Avoid race with loader/watcher thread in apps that use mapget. #81

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

MisterGC
Copy link
Contributor

@MisterGC MisterGC commented Dec 16, 2024

I am using mapget in the following situation (written in shortened pseudo-code):

main(args)
{
     service = configService();
     service.subscribe((){
          set(CONFIG_PATH_ENV, service.configPath())     
     });
     return someExternalFuncSettingConfigPath();
}

The someExternalFuncSettingConfigPath() also relies on the CONFIG_PATH_ENV set, this leads to a race.

This workaround suffices for now, but let’s discuss a solution that aligns better with the design principles of ‘mapget’.

Copy link
Contributor

@josephbirkner josephbirkner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good.

@josephbirkner josephbirkner merged commit 73410c4 into attribute-validities Dec 17, 2024
2 of 15 checks passed
@josephbirkner josephbirkner deleted the config-loading-race branch December 17, 2024 12:41
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

Successfully merging this pull request may close these issues.

2 participants