Created attachment 27050 [details] Proposed patch If there are two calls to apr_dir_make_recursive happening on the same non-existent path, at the same time, it can be that both instances call the apr_dir_make function. e.g. thread 1 calls apr_dir_make_recursive on parent thread 2 calls apr_dir_make_recursive on parent thread 1 calls apr_dir_make (returns APR_SUCCESS) thread 2 calls apr_dir_make (returns EEXIST) In this case the second thread is returned EEXIST despite the documented behaviour for the function being "No error will be reported if PATH already exists". This is a timing issue and so is relatively rare but has been observed within our product during testing. The problem can affect both simultaneous threads or simultaneous processes and due to the nature of the code could happen on any platform. A proposed patch is attached.
The patch looks good to me. Another approach would be to move the ENOENT test before the existing EEXIST case so that the EEXIST test does double duty.
r1183688, r1183713, r1183715, will be in 1.4.6
This was in 1.4.6 and later. Incidentally, a patch for a related problem was just posted to dev@apr: http://mail-archives.apache.org/mod_mbox/apr-dev/201401.mbox/%3C012801cf12c6%2403384e40%2409a8eac0%24%40qqmail.nl%3E