Atomically create and check existence of configuration and fallback directories#494
Atomically create and check existence of configuration and fallback directories#494drichardson wants to merge 1 commit intoDopplerHQ:masterfrom
Conversation
Atomically create and check directories.
|
Thank you for investigating this and putting up a fix! Your changes look good and do indeed fix the issue in my testing. Looking at your report, I suspect that there might be other race-condition-related bugs in concurrent runs of commands that modify the config file ( Two quick asks:
|
|
Yeah I can fix the commit message. I'm on vacay rn and didn't bring my computer with me so will be a couple weeks. Or feel free to rewrite my commit message, or just throw this PR in the trash and fix it elsewhere. |
|
Sounds good! I'll push your changes back up onto an internal branch. I'd typically prefer that we do it through an external PR so you can get attribution but I think that E2E test is also failing because of a secrets access issue related to the PR being external. |
|
Closing in favor of #495 |
There is a race condition when doppler CLI is run concurrently.
This PR creates/checks existence of files in one syscall (mkdir) to avoid this race condition for the configuration (
~/.doppler) and fallback (~/.doppler/fallback) directories.Closes #493
Repeated test in #493 with this change and could no longer reproduce the race condition.