Summary: | mod_disk_cache trying to rename locked file, decreasing performance | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Fr <fleger> |
Component: | mod_cache_disk / mod_disk_cache | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | RESOLVED LATER | ||
Severity: | major | CC: | covener, dbuss, sean-apache |
Priority: | P2 | Keywords: | MassUpdate, PatchAvailable |
Version: | 2.2-HEAD | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | Windows Server 2003 | ||
Attachments: | Patch which close opened files (unlock) before renaming |
Description
Fr
2006-04-05 14:46:27 UTC
mod_disk_cache makes several assumptions on how unix file systems operate, and how it is safe to move files, even if they are open. Win32 doesn't really support all of these concepts. I am not sure if we ever plan to support mod_disk_cache on win32, at least in the current incarnation. (Patches welcome of course) Created attachment 21858 [details]
Patch which close opened files (unlock) before renaming
Th problem is that the function cache_select (cache_storage.c) makes some return on error after the call to open_entity (provider) without taking care of opened files by this last function.
So to fix this behaviour, the patch add a new function to sub provider which is intended to close potential opened handles. And this function is call before each returns on error.
So, this patch need to act on 3 modules mod_cache, mod_disk_cache and mod_mem_cache. About mod_mem_cache, it needs to add the new function even if it does nothing.
I applied the patch bug found that I still had files being left open. In addition to the patch in mod_disk_cache.c I made the following changes : - set the header and body file handle to null after it's closed in multiple places - initialized the two handles to null in open_entity - in remove_entity close any open handles. Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd. As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd. If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question. If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with. Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated. |