Index: modules/proxy/mod_proxy_hcheck.c =================================================================== --- modules/proxy/mod_proxy_hcheck.c (revision 1884491) +++ modules/proxy/mod_proxy_hcheck.c (working copy) @@ -843,7 +843,6 @@ static void * APR_THREAD_FUNC hc_check(apr_thread_ "%sHealth checking %s", (thread ? "Threaded " : ""), worker->s->name); - worker->s->updated = now; if (hc->s->method == TCP) { rv = hc_check_tcp(baton); } @@ -850,13 +849,16 @@ static void * APR_THREAD_FUNC hc_check(apr_thread_ else { rv = hc_check_http(baton); } + apr_pool_destroy(baton->ptemp); + if (rv == APR_ENOTIMPL) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(03257) "Somehow tried to use unimplemented hcheck method: %d", (int)hc->s->method); - apr_pool_destroy(baton->ptemp); + worker->s->updated = apr_time_now(); return NULL; } + /* what state are we in ? */ if (PROXY_WORKER_IS_HCFAILED(worker)) { if (rv == APR_SUCCESS) { @@ -884,7 +886,7 @@ static void * APR_THREAD_FUNC hc_check(apr_thread_ } } } - apr_pool_destroy(baton->ptemp); + worker->s->updated = apr_time_now(); return NULL; } @@ -945,8 +947,9 @@ static apr_status_t hc_watchdog_callback(int state for (n = 0; n < balancer->workers->nelts; n++) { worker = *workers; if (!PROXY_WORKER_IS(worker, PROXY_WORKER_STOPPED) && - (worker->s->method != NONE) && - (now > worker->s->updated + worker->s->interval)) { + (worker->s->method != NONE) && + (worker->s->updated != 0) && + (now > worker->s->updated + worker->s->interval)) { baton_t *baton; apr_pool_t *ptemp; ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, s, @@ -956,6 +959,7 @@ static apr_status_t hc_watchdog_callback(int state if ((rv = hc_init_worker(ctx, worker)) != APR_SUCCESS) { return rv; } + /* This pool must last the lifetime of the (possible) thread */ apr_pool_create(&ptemp, ctx->p); apr_pool_tag(ptemp, "hc_request"); @@ -967,6 +971,7 @@ static apr_status_t hc_watchdog_callback(int state baton->ptemp = ptemp; baton->hc = hc_get_hcworker(ctx, worker, ptemp); + worker->s->updated = 0; if (!hctp) { hc_check(NULL, baton); }