-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fixed race condition that may result in errors in cleanup
and deprecate cleanup
#1949
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1949 +/- ##
==========================================
+ Coverage 92.65% 92.66% +0.01%
==========================================
Files 236 236
Lines 12417 12437 +20
==========================================
+ Hits 11505 11525 +20
Misses 912 912
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Hi @schlunma, I think we may need something that generates a random directory name every time you call How about creating a |
Makes sense. I guess this just hasn't surfaced yet since not many datasets actually use Just to be sure I understand this correctly: create this temporary file for each Dataset, also the non-supplementaries? |
Yes, but a directory instead of a file, since each dataset can consist of multiple files. |
a74af76
to
73c6929
Compare
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving this but I'd be happier if @bouweandela as the righteous honorable reviewer had a last look. Thanks, gents! One quick q: you making sure those tempdirs get removed right? 🍺
Did you look at the code before approving? 😝 ESMValCore/esmvalcore/_main.py Lines 459 to 470 in 2fcdf1f
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the cleanup
preprocessor function is no longer usable since #1609, we might as well remove it completely. Is that something that we would like to do in this pull request or in a different pull request?
Co-authored-by: Bouwe Andela <[email protected]>
Removing |
(I won't address the missing test in the IPSL CMORizer) |
Sorry to come up with this suggestion so late, but thinking about this a bit more: we're now creating a huge number of output directories for fix_file (one for every dataset load), while very few datasets need this. It would be better only to create the directory when we actually need it. Shall we move the temporary directory creation to the function |
Thanks a lot for your work @schlunma! Please remember to use the "deprecated feature" label if that's needed and add a note about the deprecation in the PR header 🍻 |
This used to be the behavior pre-#1609, but has been changed here: ESMValCore/esmvalcore/cmor/fix.py Lines 58 to 59 in f87e25e
I thought this was on purpose, that's why I did not change that here...I will change it. |
Great, thanks! |
Done. The fixed file directory is now only created if necessary. Note that I added an optional argument to |
cleanup
cleanup
and deprecate cleanup
Thanks very much @schlunma for tackling this last minute issue before the feature freeze! And also many thanks to @bouweandela and @valeriupredoi for the reviews! I'm going to merge now. This means: feature freeze is now and we're finalizing v2.8.0rc1 🍺 |
Description
This PR removes the race condition that may lead to errors in the
cleanup
preprocessor by using temporary directories to store fixed files.Closes #1948
Deprecation
This PR deprecates the
cleanup
preprocessor, which is not needed anymore. Users should not use that anymore.Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
To help with the number pull requests: