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

CLI race condition: Simultaneous writes to cblue_configuration.json #75

Open
AustinZAnderson opened this issue Jan 3, 2025 · 0 comments · May be fixed by #76
Open

CLI race condition: Simultaneous writes to cblue_configuration.json #75

AustinZAnderson opened this issue Jan 3, 2025 · 0 comments · May be fixed by #76

Comments

@AustinZAnderson
Copy link
Collaborator

AustinZAnderson commented Jan 3, 2025

When running multiple cBlue CLI processes in parallel, we discovered what looks to be a race condition. The cblue_configuration.json is a single file in the cBlue app folder, and every parallel process will attempt to update its contents. When two or more processes try to update this file at the same time, we get a JSONDecodeError on line 224 of CBlueApp.py.

I addressed this for our production team by adding an argument to the CLI called --save_config. I turned this option off by default for the CLI, and on by default for the GUI. I would be happy to submit my code for review as a PR or by other means. It looks like I don't currently have the needed permissions to submit a PR.

@AustinZAnderson AustinZAnderson changed the title CLI race condition: Concurrent writes to cblue_configuration.json CLI race condition: Simultaneous writes to cblue_configuration.json Jan 3, 2025
@AustinZAnderson AustinZAnderson linked a pull request Jan 18, 2025 that will close this issue
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 a pull request may close this issue.

1 participant