mturk       2004/08/10 11:06:49

  Modified:    ajp/proxy proxy_util.c
  Log:
  Add some extra debugging to ease the bug chasing :)
  
  Revision  Changes    Path
  1.25      +32 -6     jakarta-tomcat-connectors/ajp/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/proxy_util.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- proxy_util.c      10 Aug 2004 14:58:24 -0000      1.24
  +++ proxy_util.c      10 Aug 2004 18:06:49 -0000      1.25
  @@ -1342,7 +1342,7 @@
   {
       proxy_conn_rec *conn = (proxy_conn_rec *)theconn;
       proxy_worker *worker = conn->worker;
  -
  +    
       /* deterimine if the connection need to be closed */
       if (conn->close_on_recycle) {
           if (conn->sock)
  @@ -1455,6 +1455,10 @@
                                   worker->hmax, worker->ttl,
                                   connection_constructor, connection_destructor,
                                   s, worker->cp->pool);
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                     "proxy: initialized worker for (%s) min=%d max=%d smax=%d",
  +                      worker->hostname, worker->min, worker->hmax, worker->smax);
  +
   #if (APR_MAJOR_VERSION > 0)
           /* Set the acquire timeout */
           if (rv == APR_SUCCESS && worker->acquire_set)
  @@ -1467,7 +1471,11 @@
           
           connection_constructor((void **)&(worker->cp->conn), s, worker->cp->pool);
           rv = APR_SUCCESS;
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                     "proxy: initialized single connection worker for (%s)",
  +                      worker->hostname);
       }
  +
       return rv;
   }
   
  @@ -1478,14 +1486,17 @@
       if (worker->status & PROXY_WORKER_IN_ERROR) {
           apr_interval_time_t diff;
           apr_time_t now = apr_time_now();
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                    "proxy: %s: retrying the worker for (%s)",
  +                     proxy_function, worker->hostname);
           if (worker->retry)
               diff = worker->retry;
           else
  -            diff = apr_time_from_sec(60 + 60 * worker->retries++);
  +            diff = apr_time_from_sec((60 + 60 * worker->retries++));
           if (now > worker->error_time + diff) {
               worker->status &= ~PROXY_WORKER_IN_ERROR;
               ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  -                         "proxy: %s: retrying the worker for (%s)",
  +                         "proxy: %s: worker for (%s) has been marked for retry",
                            proxy_function, worker->hostname);
               return OK;
           }
  @@ -1547,6 +1558,12 @@
                        proxy_function, worker->hostname);
           return HTTP_SERVICE_UNAVAILABLE;
       }
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                 "proxy: %s: has acquired connection for (%s)",
  +                 proxy_function, worker->hostname);
  +
  +    (*conn)->worker = worker;
  +
       return OK;
   }
   
  @@ -1556,11 +1573,15 @@
   {
       apr_status_t rv = APR_SUCCESS;
   
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                 "proxy: %s: has relesed connection for (%s)",
  +                 proxy_function, conn->worker->hostname);
       /* If there is a connection kill it's cleanup */
       if (conn->connection)
           apr_pool_cleanup_kill(conn->connection->pool, conn, connection_cleanup);
       connection_cleanup(conn);
       conn->connection = NULL;
  +
       return OK;
   }
   
  @@ -1594,7 +1615,7 @@
       }
   
       ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
  -                 "proxy: HTTP connecting %s to %s:%d", *url, uri->hostname,
  +                 "proxy: connecting %s to %s:%d", *url, uri->hostname,
                    uri->port);
   
       /* allocate these out of the specified connection pool 
  @@ -1691,7 +1712,6 @@
               conn->sock = NULL;
           }
       }
  -
       while (backend_addr && !connected) {
           if ((rv = apr_socket_create(&newsock, backend_addr->family,
                                   SOCK_STREAM, APR_PROTO_TCP,
  @@ -1757,7 +1777,6 @@
           }
           
           conn->sock   = newsock;
  -        conn->worker = worker;
           connected    = 1;
       }
       /* Put the entire worker to error state
  @@ -1767,6 +1786,13 @@
       if (!connected && PROXY_WORKER_IS_USABLE(worker)) {
           worker->status |= PROXY_WORKER_IN_ERROR;
           worker->error_time = apr_time_now();
  +        ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
  +            "ap_proxy_connect_backend disabling worker for (%s)",
  +            worker->hostname);
  +    }
  +    else {
  +        worker->error_time = 0;
  +        worker->retries = 0;
       }
       return connected ? OK : DECLINED;
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to