add lock for the dune-py cache
This is how I implemented a lock for the dune-py cache using portalocker. I'm not sure whether this prevents all race conditions. It adds portalocker as a mandatory dependency.
Merge request reports
Activity
@nils.dreier this looks like the right thing to do, thanks. Would you mind rebasing and then we could add the dependency to the python/setup.py.in file as well, i.e., install_requires=[portalocker} (there are probably more things we could put there).
added 28 commits
-
cb25463d...318c837f - 26 commits from branch
staging:master
- 8bff363d - add lock for the dune-py cache
- 2b90e25b - add install_requires to setup.py.in
-
cb25463d...318c837f - 26 commits from branch
I do see one issue. In
generator/generator.py
the actualcc
file is written in the cache that could lead to a problem if two scripts are trying to generate the same module. For example if I simply run the same script twice with different parameters and both try to generate a yaspgrid module then the cc file will be corrupted. I tried to fix this by surrounding the whole if/elif/else statement starting withif not os.path.isfile(sourceFileName):
in thewhile
statement. I don't think this is the best solutions - perhaps one should lock the cc file exclusively?Edited by Andreas Dednermentioned in merge request !131 (merged)
@nils.dreier switched to !131 (merged) because it seemed easier to move the source branch into dune-python. I added a fix that seems to solve the problem I mentioned above. Could you have a look if it makes sense?
mentioned in commit b10c4162