httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 50317] Possible error in mod_cache's "Avoiding the Thundering Herd"
Date Thu, 22 May 2014 11:36:02 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50317

--- Comment #37 from Ruediger Pluem <rpluem@apache.org> ---
Does the patch below fix the two keys issue?

Index: mod_cache.c
===================================================================
--- mod_cache.c (revision 1595827)
+++ mod_cache.c (working copy)
@@ -113,7 +113,19 @@
     if (rv != OK) {
         if (rv == DECLINED) {
             if (!lookup) {
+                char *key;

+                /*
+                 * Try to use the key of a possible open but stall cache
+                 * entry if we have one.
+                 */
+                if ((cache->handle != NULL) &&
+                    (cache->handle->cache_obj != NULL)) {
+                    key = cache->handle->cache_obj->key;
+                }
+                else {
+                    key = NULL;
+                }
                 /* try to obtain a cache lock at this point. if we succeed,
                  * we are the first to try and cache this url. if we fail,
                  * it means someone else is already trying to cache this
@@ -121,7 +133,7 @@
                  * backend without any attempt to cache. this stops
                  * duplicated simultaneous attempts to cache an entity.
                  */
-                rv = ap_cache_try_lock(conf, r, NULL);
+                rv = ap_cache_try_lock(conf, r, key);
                 if (APR_SUCCESS == rv) {

                     /*

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