-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
Possible race in CacheDir config #4489
Comments
Note the MSVC config caching recently has locking added, using the new |
Thank you for the quick response and my apologies for not responding myself, I tend not to check GitHub very often. Let me know if you need any help or any additional information about the issue. In our sconstruct, we've bypassed the issue by calling CacheDir directly as soon as we know what directory our cache will use, but before spawning any jobs. |
Are you spawning off other scons runs? or just regular build tasks? |
Yeah, I'd say unless you're planning to have distinct CacheDir setups per environment, getting it set up early is good practice anyway. |
When creating a new CacheDir, the config file is created in exclusive mode, but there's a timing window before the json dump to the file completes when another thread could read the config because it exists - but get a JSONDecodeError because it hasn't finished writing yet. Add locking so the readers will have to wait until the writer is done. Fixes SCons#4489 Signed-off-by: Mats Wichmann <mats@linux.com>
It should just be regular build tasks, with custom actions. |
This was filed as a comment to closed PR #3353 by @mtvjr. Moving to a fresh issue because I believe it to be a different problem, plus that PR has been closed for over four years.
================
Looks like this might not completely make things thread safe. We just ran into an issue where it appears the cache file is attempted to be read between file creation and the
json.dump
call finishing. Thejson.load
call failed due to an empty input file.The text was updated successfully, but these errors were encountered: