httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44696] mod_cache sometimes serves old content despite having fetched new content
Date Tue, 12 Aug 2008 10:19:38 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44696





--- Comment #1 from rahul <rahul@sun.com>  2008-08-12 03:19:37 PST ---
Created an attachment (id=22429)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22429)
Patch to store body before headers

The race condition happens when there are multiple http workers,
After the first request detects that the cache has expired, it tries to update
the cache in cache_save_filter.
Here, the storing of the new data takes place in two steps, first the headers
are stored, and then the body.

If a request comes to a second http worker when the headers are already written
but the body is not, the second http-worker assumes that the cached body is
valid (since the headers are valid). This causes the second worker to return
the stale cache.

The fix is the switch the order of writing the cache so that body is written
first. With this, if there is a second request before headers are stored, the
second http-worker only assumes that the cache is stale and fetches it again,
and overwrites the cache again.


-- 
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


Mime
View raw message