-
Notifications
You must be signed in to change notification settings - Fork 26
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
make debug-test fails with 404 error #1954
make debug-test fails with 404 error #1954
Comments
From slack chat: Nikhil Woodruff |
Looking to see if I can locate "I recently changed the API to downloading it at startup time rather than whenever the first UK impact is received"... Looks like it's related to Split simulations into chunks #1938 Specifically this bit adding download_microdata.py |
Chatted with @nikhilwoodruff this morning. TLDR: we want to load the UK data on demand, but without causing a race condition. What's going wrong and why
SO SolutionsPreferred solution: We're loading this into memory anyway. Instead of caching it on disk we could just load it directly into memory once per worker Pros:
Alternative - Atomic downloadDownload to a randomly-named tmp file and then use a move (if you move within the same disk partition this is atomic, not a copy) to the name you want. Then either the file is there or not. If two processes do it at the same time, they will all download it, but one will "win". Pros:
|
Looking a bit more closely... I'm not 100% confident that I know all the places file_path is used. I think I'll just solve this one problem of making the file download atomic (option 2) in this one case. |
put in a pull request to core here: PolicyEngine/policyengine-core#307 that will make the download/write atomic. This should let us just back out the preloading of the microdata which will in turn mean we don't get errors for trying to download the UK microdata. |
When running make debug-test on the policyengine-api package I get the following error:
The text was updated successfully, but these errors were encountered: