You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2010/07/01 09:52:32 UTC

DO NOT REPLY [Bug 49391] mod_disk_cache needs to register a cleanup to kill failed responses

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

M8R-cxm5si@mailinator.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|PC                          |All
         OS/Version|Mac OS X 10.5               |All

--- Comment #2 from M8R-cxm5si@mailinator.com 2010-07-01 03:52:29 EDT ---
See many aptmp* files on Solaris webservers too.

Looking at mod_disk_cache.c it appears that:
  1. a tmp file is created, headers written, and tmp file renamed to header
file
      i.e. store_headers()
  2. a tmp file is created, some data written
      i.e. store_body() for each bucket brigade
  3.   ... more data written to tmp file
      i.e. store_body()
  4. file_cache_el_final() is called to rename tmp file to data file

If a client terminates a connection (presses STOP in their browser, quite a
common thing to happen that should be correctly handled) then it is likely that
store_body() will not be called with a APR_BUCKET_IS_EOS() final bucket. Hence
file_cache_el_final() will never be called.

It would be undesirable to call file_cache_el_final() in the event the
connection was broken because we wouldn't want a partial (invalid) cached
object persisting.

It would be undesirable to use a pool call back to call
file_cache_errorcleanup() in a pool cleanup if the cache store was successful.

So, suggest add a new member to disk_cache_object_t* dobj, an ENUM with the
following states:
  MOD_DISK_CACHE_NOCACHE
  MOD_DISK_CACHE_HEADERCACHED
  MOD_DISK_CACHE_DATAPARTIALCACHED
  MOD_DISK_CACHE_CACHED

Then register a cleanup function with request pool (r->pool). If state is
NOCACHE or CACHED then merely return. If state is HEADERCACHED then remove the
header. If state is DATAPARTIALCACHED then remove header and tmpfile.

Considering that an aborted connection is common place on any serious server
this should have a high priority.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org