]> granicus.if.org Git - apache/commitdiff
better logging for re-use/use of shm
authorJim Jagielski <jim@apache.org>
Thu, 8 Nov 2012 14:01:37 +0000 (14:01 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 8 Nov 2012 14:01:37 +0000 (14:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1407085 13f79535-47bb-0310-9956-ffa450edef68

docs/log-message-tags/next-number
modules/proxy/proxy_util.c

index 65b7a7f809ae570dfdd3026052d7a6e953a88330..1475ea901925aa931bd5c6197af04a2de2d4feac 100644 (file)
@@ -1 +1 @@
-2402
+2404
index e462334f78e8692c0b0677ef780ffe1e39ac8be4..dd3c563fd6e4ceb0ee89c89973e00496692c056b 100644 (file)
@@ -1200,7 +1200,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_share_balancer(proxy_balancer *balancer,
 {
     apr_status_t rv = APR_SUCCESS;
     proxy_balancer_method *lbmethod;
-    char *ptr = "";
+    char *action = "copying";
     if (!shm || !balancer->s)
         return APR_EINVAL;
 
@@ -1210,10 +1210,11 @@ PROXY_DECLARE(apr_status_t) ap_proxy_share_balancer(proxy_balancer *balancer,
         if (balancer->s->was_malloced)
             free(balancer->s);
     } else {
-        ptr = "not ";
+        action = "re-using";
     }
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02337)
-                 "%scopying shm for %s", ptr, balancer->s->name);
+                 "%s shm[%d] (0x%pp) for %s", action, i, (void *)shm,
+                 balancer->s->name);
     balancer->s = shm;
     balancer->s->index = i;
     /* the below should always succeed */
@@ -1647,7 +1648,7 @@ PROXY_DECLARE(char *) ap_proxy_define_worker(apr_pool_t *p,
 PROXY_DECLARE(apr_status_t) ap_proxy_share_worker(proxy_worker *worker, proxy_worker_shared *shm,
                                                   int i)
 {
-    char *ptr = "";
+    char *action = "copying";
     if (!shm || !worker->s)
         return APR_EINVAL;
 
@@ -1657,10 +1658,11 @@ PROXY_DECLARE(apr_status_t) ap_proxy_share_worker(proxy_worker *worker, proxy_wo
         if (worker->s->was_malloced)
             free(worker->s); /* was malloced in ap_proxy_define_worker */
     } else {
-        ptr = "not ";
+        action = "re-using";
     }
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02338)
-                 "%scopying shm for worker: %s", ptr, worker->s->name);
+                 "%s shm[%d] (0x%pp) for worker: %s", action, i, (void *)shm,
+                 worker->s->name);
 
     worker->s = shm;
     worker->s->index = i;
@@ -2743,6 +2745,9 @@ PROXY_DECLARE(apr_status_t) ap_proxy_sync_balancer(proxy_balancer *b, server_rec
             proxy_worker *worker = *workers;
             if (worker->hash.def == shm->hash.def && worker->hash.fnv == shm->hash.fnv) {
                 found = 1;
+                ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02402)
+                             "re-grabbing shm[%d] (0x%pp) for worker: %s", i, (void *)shm,
+                             worker->s->name);
                 break;
             }
         }
@@ -2760,6 +2765,9 @@ PROXY_DECLARE(apr_status_t) ap_proxy_sync_balancer(proxy_balancer *b, server_rec
                 ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, APLOGNO(00966) "Cannot init worker");
                 return rv;
             }
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(02403)
+                         "grabbing shm[%d] (0x%pp) for worker: %s", i, (void *)shm,
+                         (*runtime)->s->name);
         }
     }
     if (b->s->need_reset) {