https://issues.apache.org/bugzilla/show_bug.cgi?id=50317

--- Comment #46 from [email protected] ---
I have good results with following patch (on top of the patch in Comment 41):

diff --git a/modules/cache/mod_disk_cache.c b/modules/cache/mod_disk_cache.c
index 13d6c8b..305fa6b 100644
--- a/modules/cache/mod_disk_cache.c
+++ b/modules/cache/mod_disk_cache.c
@@ -962,15 +962,6 @@ static apr_status_t store_headers(cache_handle_t *h,
request_rec *r, cache_info

     apr_file_close(dobj->hfd); /* flush and close */

-    /* Remove old file with the same name. If remove fails, then
-     * perhaps we need to create the directory tree where we are
-     * about to write the new headers file.
-     */
-    rv = apr_file_remove(dobj->hdrsfile, r->pool);
-    if (rv != APR_SUCCESS) {
-        mkdir_structure(conf, dobj->hdrsfile, r->pool);
-    }
-
     rv = safe_file_rename(conf, dobj->tempfile, dobj->hdrsfile, r->pool);
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server,

I think the race condition exists between this apr_file_remove and
safe_file_rename. There is no cached file between these two calls.
safe_file_rename should overwrite any existing file with the same name, so
there's no need for apr_file_remove imho.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to