Affects Version/s: 2.9
Fix Version/s: None
- Run provided unit tests
The unit tests do not cover race conditions. If you can think of some witty and novel way of testing race conditions, please do!
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
The make_temp_directory() function is meant to only be used to create directories which are only present for the current request.
Therefore it should be possible to enforce this, however it's never been enforced before, so doing so now would be light juggling razors.
We should create a new per-request directory helper (make_request_directory()), which:
- does not take a dirname argument (too tempting to play silly buggers with it); and
- is automatically removed at the end of the process.
We can then start to replace all uses of make_temp_directory() with this, and eventually deprecate make_temp_directory altogether.
Since request directories should be local to individual web server (in a clustered environment), we ideally want the new directory to be in local storage, and not shared storage. To do so, we can either:
- create a new directory requirement and config setting; or
- (ab?)use localcachedir.
For the moment, I've used the localcachedir option as I feel that it is a suitable location in this instance.