]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: proxy: replace proxy->state with proxy->disabled
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Sep 2020 06:39:22 +0000 (08:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2020 09:27:30 +0000 (11:27 +0200)
The remaining proxy states were only used to distinguish an enabled
proxy from a disabled one. Due to the initialization order, both
PR_STNEW and PR_STREADY were equivalent after startup, and they
would only differ from PR_STSTOPPED when the proxy is disabled or
shutdown (which is effectively another way to disable it).

Now we just have a "disabled" field which allows to distinguish them.
It's becoming obvious that start_proxies() is only used to print a
greeting message now, that we'd rather get rid of. Probably that
zombify_proxy() and stop_proxy() should be merged once their
differences move to the right place.

18 files changed:
contrib/prometheus-exporter/service-prometheus.c
include/haproxy/backend.h
include/haproxy/proxy-t.h
src/cfgparse-listen.c
src/cfgparse.c
src/check.c
src/cli.c
src/extcheck.c
src/haproxy.c
src/mux_fcgi.c
src/mux_h1.c
src/mux_h2.c
src/mworker.c
src/proxy.c
src/server.c
src/stats.c
src/stick_table.c
src/stream.c

index ba1619f47aa34c1258c73241d7107d61a4b2c9b5..b6c38eb579fae5c7aaeec84a747e9d4a4c3035de 100644 (file)
@@ -1546,12 +1546,12 @@ static int promex_dump_front_metrics(struct appctx *appctx, struct htx *htx)
                        px = appctx->ctx.stats.obj1;
 
                        /* skip the disabled proxies, global frontend and non-networked ones */
-                       if (px->state == PR_STSTOPPED || px->uuid <= 0 || !(px->cap & PR_CAP_FE))
+                       if (px->disabled || px->uuid <= 0 || !(px->cap & PR_CAP_FE))
                                goto next_px;
 
                        switch (appctx->st2) {
                                case ST_F_STATUS:
-                                       metric = mkf_u32(FO_STATUS, px->state == PR_STREADY ? 1 : 0);
+                                       metric = mkf_u32(FO_STATUS, !px->disabled);
                                        break;
                                case ST_F_SCUR:
                                        metric = mkf_u32(0, px->feconn);
@@ -1731,7 +1731,7 @@ static int promex_dump_back_metrics(struct appctx *appctx, struct htx *htx)
                        px = appctx->ctx.stats.obj1;
 
                        /* skip the disabled proxies, global frontend and non-networked ones */
-                       if (px->state == PR_STSTOPPED || px->uuid <= 0 || !(px->cap & PR_CAP_BE))
+                       if (px->disabled || px->uuid <= 0 || !(px->cap & PR_CAP_BE))
                                goto next_px;
 
                        switch (appctx->st2) {
@@ -1976,7 +1976,7 @@ static int promex_dump_srv_metrics(struct appctx *appctx, struct htx *htx)
                        px = appctx->ctx.stats.obj1;
 
                        /* skip the disabled proxies, global frontend and non-networked ones */
-                       if (px->state == PR_STSTOPPED || px->uuid <= 0 || !(px->cap & PR_CAP_BE))
+                       if (px->disabled || px->uuid <= 0 || !(px->cap & PR_CAP_BE))
                                goto next_px;
 
                        while (appctx->ctx.stats.obj2) {
index f6b25e7bee4ac9813101692c8b9854aaf7f8a4fa..8a763bfbdc4b29a4d4bc7ba2daeca5ac324128b8 100644 (file)
@@ -52,7 +52,7 @@ int be_lastsession(const struct proxy *be);
 /* Returns number of usable servers in backend */
 static inline int be_usable_srv(struct proxy *be)
 {
-        if (be->state == PR_STSTOPPED)
+        if (be->disabled)
                 return 0;
         else if (be->srv_act)
                 return be->srv_act;
index aa8038dd10bad2693570485507f34ee15532721d..a17537aa5ab882d9eea5cc0b7cf272d278fa3b5c 100644 (file)
 #include <haproxy/thread-t.h>
 #include <haproxy/uri_auth-t.h>
 
-/* values for proxy->state */
-enum pr_state {
-       PR_STNEW = 0,           /* proxy has not been initialized yet */
-       PR_STREADY,             /* proxy has been initialized and is ready */
-       PR_STSTOPPED,           /* proxy is stopped (end of a restart) */
-} __attribute__((packed));
-
 /* values for proxy->mode */
 enum pr_mode {
        PR_MODE_TCP = 0,
@@ -252,7 +245,7 @@ struct error_snapshot {
 
 struct proxy {
        enum obj_type obj_type;                 /* object type == OBJ_TYPE_PROXY */
-       enum pr_state state;                    /* proxy state, one of PR_* */
+       char disabled;                          /* non-zero if disabled or shutdown */
        enum pr_mode mode;                      /* mode = PR_MODE_TCP, PR_MODE_HTTP or PR_MODE_HEALTH */
        char cap;                               /* supported capabilities (PR_CAP_*) */
        unsigned int maxconn;                   /* max # of active streams on the frontend */
index 665be769ef117852e5cec0672cffa999c7a6ed2d..cda55e658b0f8fb6e495b9b3d413e79c7640b4fc 100644 (file)
@@ -245,7 +245,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                memcpy(&curproxy->defsrv, &defproxy.defsrv, sizeof(curproxy->defsrv));
                curproxy->defsrv.id = "default-server";
 
-               curproxy->state = defproxy.state;
+               curproxy->disabled = defproxy.disabled;
                curproxy->options = defproxy.options;
                curproxy->options2 = defproxy.options2;
                curproxy->no_options = defproxy.no_options;
@@ -783,12 +783,12 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
        else if (!strcmp(args[0], "disabled")) {  /* disables this proxy */
                if (alertif_too_many_args(0, file, linenum, args, &err_code))
                        goto out;
-               curproxy->state = PR_STSTOPPED;
+               curproxy->disabled = 1;
        }
        else if (!strcmp(args[0], "enabled")) {  /* enables this proxy (used to revert a disabled default) */
                if (alertif_too_many_args(0, file, linenum, args, &err_code))
                        goto out;
-               curproxy->state = PR_STNEW;
+               curproxy->disabled = 0;
        }
        else if (!strcmp(args[0], "bind-process")) {  /* enable this proxy only on some processes */
                int cur_arg = 1;
index 92d02cad2b15c4571c89405b9b40bdbe815bf28e..0bc4b82a2614b267356cbe76dacc1a3f3df1a1d5 100644 (file)
@@ -414,7 +414,7 @@ void init_default_instance()
 {
        init_new_proxy(&defproxy);
        defproxy.mode = PR_MODE_TCP;
-       defproxy.state = PR_STNEW;
+       defproxy.disabled = 0;
        defproxy.maxconn = cfg_maxpconn;
        defproxy.conn_retries = CONN_RETRIES;
        defproxy.redispatch_after = 0;
@@ -2117,7 +2117,7 @@ void propagate_processes(struct proxy *from, struct proxy *to)
        if (!(from->cap & PR_CAP_FE))
                return;
 
-       if (from->state == PR_STSTOPPED)
+       if (from->disabled)
                return;
 
        /* default_backend */
@@ -2234,7 +2234,7 @@ int check_config_validity()
                next_pxid++;
 
 
-               if (curproxy->state == PR_STSTOPPED) {
+               if (curproxy->disabled) {
                        /* ensure we don't keep listeners uselessly bound. We
                         * can't disable their listeners yet (fdtab not
                         * allocated yet) but let's skip them.
@@ -3949,7 +3949,7 @@ out_uri_auth_compat:
         * other proxies.
         */
        for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
-               if (curproxy->state == PR_STSTOPPED || !curproxy->table)
+               if (curproxy->disabled || !curproxy->table)
                        continue;
 
                if (!stktable_init(curproxy->table)) {
index 8d3cd6f93610140da680bf7d859924c7b4b7c5ff..88c78ed622b95bebf831ad72af39f6ac9529d8ee 100644 (file)
@@ -859,7 +859,7 @@ static struct task *process_chk_conn(struct task *t, void *context, unsigned sho
                 * is disabled.
                 */
                if (((check->state & (CHK_ST_ENABLED | CHK_ST_PAUSED)) != CHK_ST_ENABLED) ||
-                   proxy->state == PR_STSTOPPED)
+                   proxy->disabled)
                        goto reschedule;
 
                /* we'll initiate a new check */
index f34f9916f2f4a19ed4148bd1d89a1fa6ae690ba7..b331bd3e51b40f76d424a224487741a0b168812f 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -2428,7 +2428,6 @@ int mworker_cli_proxy_create()
        proxies_list = mworker_proxy;
        mworker_proxy->id = strdup("MASTER");
        mworker_proxy->mode = PR_MODE_CLI;
-       mworker_proxy->state = PR_STNEW;
        mworker_proxy->last_change = now.tv_sec;
        mworker_proxy->cap = PR_CAP_LISTEN; /* this is a listen section */
        mworker_proxy->maxconn = 10;                 /* default to 10 concurrent connections */
index dd7c942404ec7d6a321a748e81a32d241d2ccb9b..96d61c94e5e906ceb1da0547762f287d248bd95b 100644 (file)
@@ -495,7 +495,7 @@ struct task *process_chk_proc(struct task *t, void *context, unsigned short stat
                 * is disabled.
                 */
                if (((check->state & (CHK_ST_ENABLED | CHK_ST_PAUSED)) != CHK_ST_ENABLED) ||
-                   s->proxy->state == PR_STSTOPPED)
+                   s->proxy->disabled)
                        goto reschedule;
 
                /* we'll initiate a new check */
index aa865f0f84f9a902d67c3604f8dfc0238a1d0465..23cfa246e8be382c743fcf1d11afe805bb5802c5 100644 (file)
@@ -2010,7 +2010,7 @@ static void init(int argc, char **argv)
                                break;
 
                for (px = proxies_list; px; px = px->next)
-                       if (px->state != PR_STSTOPPED && px->li_all)
+                       if (!px->disabled && px->li_all)
                                break;
 
                if (pr || px) {
@@ -2340,7 +2340,7 @@ static void init(int argc, char **argv)
 
        /* stop disabled proxies */
        for (px = proxies_list; px; px = px->next) {
-               if (px->state == PR_STSTOPPED)
+               if (px->disabled)
                        stop_proxy(px);
        }
 
@@ -3511,7 +3511,7 @@ int main(int argc, char **argv)
                /* we might have to unbind some proxies from some processes */
                px = proxies_list;
                while (px != NULL) {
-                       if (px->bind_proc && px->state != PR_STSTOPPED) {
+                       if (px->bind_proc && !px->disabled) {
                                if (!(px->bind_proc & (1UL << proc))) {
                                        if (global.tune.options & GTUNE_SOCKET_TRANSFER)
                                                zombify_proxy(px);
@@ -3525,7 +3525,7 @@ int main(int argc, char **argv)
                /* we might have to unbind some log forward proxies from some processes */
                px = cfg_log_forward;
                while (px != NULL) {
-                       if (px->bind_proc && px->state != PR_STSTOPPED) {
+                       if (px->bind_proc && !px->disabled) {
                                if (!(px->bind_proc & (1UL << proc))) {
                                        if (global.tune.options & GTUNE_SOCKET_TRANSFER)
                                                zombify_proxy(px);
index b6b1feb3cecd53ba06cb6f4206081a46073b9f14..2856cf2853ebc368d4ac78cfe9b6fa7f49f8f14d 100644 (file)
@@ -3001,7 +3001,7 @@ static int fcgi_process(struct fcgi_conn *fconn)
        }
        fcgi_send(fconn);
 
-       if (unlikely(fconn->proxy->state == PR_STSTOPPED)) {
+       if (unlikely(fconn->proxy->disabled)) {
                /* frontend is stopping, reload likely in progress, let's try
                 * to announce a graceful shutdown if not yet done. We don't
                 * care if it fails, it will be tried again later.
index a7fed2a6f876ce2c5d5a29be478e714869626e7c..23cc72f1f1a1f3332ecf4efa9ee895ff5d68732c 100644 (file)
@@ -888,7 +888,7 @@ static void h1_set_cli_conn_mode(struct h1s *h1s, struct h1m *h1m)
        }
 
        /* If KAL, check if the frontend is stopping. If yes, switch in CLO mode */
-       if (h1s->flags & H1S_F_WANT_KAL && fe->state == PR_STSTOPPED) {
+       if (h1s->flags & H1S_F_WANT_KAL && fe->disabled) {
                h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO;
                TRACE_STATE("stopping, set close mode", H1_EV_RX_DATA|H1_EV_RX_HDRS|H1_EV_TX_DATA|H1_EV_TX_HDRS, h1s->h1c->conn, h1s);
        }
@@ -952,7 +952,7 @@ static void h1_set_srv_conn_mode(struct h1s *h1s, struct h1m *h1m)
        }
 
        /* If KAL, check if the backend is stopping. If yes, switch in CLO mode */
-       if (h1s->flags & H1S_F_WANT_KAL && be->state == PR_STSTOPPED) {
+       if (h1s->flags & H1S_F_WANT_KAL && be->disabled) {
                h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO;
                TRACE_STATE("stopping, set close mode", H1_EV_RX_DATA|H1_EV_RX_HDRS|H1_EV_TX_DATA|H1_EV_TX_HDRS, h1s->h1c->conn, h1s);
        }
index 9c87218c6994f82f0dfe5e5f8e448b85dde95feb..1b73d2b46ffa5a6a95783ddfebe8859b29f9aa78 100644 (file)
@@ -3609,7 +3609,7 @@ static int h2_process(struct h2c *h2c)
        }
        h2_send(h2c);
 
-       if (unlikely(h2c->proxy->state == PR_STSTOPPED)) {
+       if (unlikely(h2c->proxy->disabled)) {
                /* frontend is stopping, reload likely in progress, let's try
                 * to announce a graceful shutdown if not yet done. We don't
                 * care if it fails, it will be tried again later.
index d6365e120e0d6038c59bcc419ca61351c77bd781..2ef7e7dd742c42b2f2270a2b421a02b9361740d3 100644 (file)
@@ -437,7 +437,7 @@ void mworker_cleanlisteners()
                }
                /* if the proxy shouldn't be in the master, we stop it */
                if (!listen_in_master)
-                       curproxy->state = PR_STSTOPPED;
+                       curproxy->disabled = 1;
        }
 }
 
index bae8c1410b72bc1e98e5458889c60ec93b4374d6..7bcfa9578a73d8e1b2644504e8fa87520ac677ff 100644 (file)
@@ -1052,10 +1052,8 @@ void start_proxies(void)
        struct proxy *curproxy;
 
        for (curproxy = proxies_list; curproxy != NULL; curproxy = curproxy->next) {
-               if (curproxy->state != PR_STNEW)
-                       continue; /* already initialized */
-
-               curproxy->state = PR_STREADY;
+               if (curproxy->disabled)
+                       continue;
                send_log(curproxy, LOG_NOTICE, "Proxy %s started.\n", curproxy->id);
        }
 }
@@ -1078,7 +1076,7 @@ struct task *manage_proxy(struct task *t, void *context, unsigned short state)
         */
 
        /* first, let's check if we need to stop the proxy */
-       if (unlikely(stopping && p->state != PR_STSTOPPED)) {
+       if (unlikely(stopping && !p->disabled)) {
                int t;
                t = tick_remain(now_ms, p->stop_time);
                if (t == 0) {
@@ -1102,7 +1100,7 @@ struct task *manage_proxy(struct task *t, void *context, unsigned short state)
         * be in neither list. Any entry being dumped will have ref_cnt > 0.
         * However we protect tables that are being synced to peers.
         */
-       if (unlikely(stopping && p->state == PR_STSTOPPED && p->table && p->table->current)) {
+       if (unlikely(stopping && p->disabled && p->table && p->table->current)) {
                if (!p->table->syncing) {
                        stktable_trash_oldest(p->table, p->table->current);
                        pool_gc(NULL);
@@ -1230,7 +1228,7 @@ void soft_stop(void)
        p = proxies_list;
        tv_update_date(0,1); /* else, the old time before select will be used */
        while (p) {
-               if (p->state != PR_STSTOPPED) {
+               if (!p->disabled) {
                        ha_warning("Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace);
                        send_log(p, LOG_WARNING, "Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace);
                        p->stop_time = tick_add(now_ms, p->grace);
@@ -1257,7 +1255,7 @@ void soft_stop(void)
        p = cfg_log_forward;
        while (p) {
                /* Zombie proxy, let's close the file descriptors */
-               if (p->state == PR_STSTOPPED &&
+               if (p->disabled &&
                    !LIST_ISEMPTY(&p->conf.listeners) &&
                    LIST_ELEM(p->conf.listeners.n,
                    struct listener *, by_fe)->state > LI_ASSIGNED) {
@@ -1269,7 +1267,7 @@ void soft_stop(void)
                        }
                }
 
-               if (p->state != PR_STSTOPPED) {
+               if (!p->disabled) {
                        stop_proxy(p);
                }
                p = p->next;
@@ -1288,7 +1286,7 @@ int pause_proxy(struct proxy *p)
 {
        struct listener *l;
 
-       if (!(p->cap & PR_CAP_FE) || p->state == PR_STSTOPPED || !p->li_ready)
+       if (!(p->cap & PR_CAP_FE) || p->disabled || !p->li_ready)
                return 1;
 
        ha_warning("Pausing %s %s.\n", proxy_cap_str(p->cap), p->id);
@@ -1318,7 +1316,7 @@ void zombify_proxy(struct proxy *p)
                if (l->state >= LI_ASSIGNED)
                        delete_listener(l);
        }
-       p->state = PR_STSTOPPED;
+       p->disabled = 1;
 }
 
 /*
@@ -1352,7 +1350,7 @@ void stop_proxy(struct proxy *p)
                }
        }
        if (!nostop)
-               p->state = PR_STSTOPPED;
+               p->disabled = 1;
 
        HA_SPIN_UNLOCK(PROXY_LOCK, &p->lock);
 }
@@ -1367,7 +1365,7 @@ int resume_proxy(struct proxy *p)
        struct listener *l;
        int fail;
 
-       if (p->state == PR_STSTOPPED || !p->li_paused)
+       if (p->disabled || !p->li_paused)
                return 1;
 
        ha_warning("Enabling %s %s.\n", proxy_cap_str(p->cap), p->id);
@@ -1685,7 +1683,7 @@ void proxy_adjust_all_maxconn()
        struct switching_rule *swrule1, *swrule2;
 
        for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
-               if (curproxy->state == PR_STSTOPPED)
+               if (curproxy->disabled)
                        continue;
 
                if (!(curproxy->cap & PR_CAP_FE))
@@ -1729,7 +1727,7 @@ void proxy_adjust_all_maxconn()
         * loop above because cross-references are not yet fully resolved.
         */
        for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
-               if (curproxy->state == PR_STSTOPPED)
+               if (curproxy->disabled)
                        continue;
 
                /* If <fullconn> is not set, let's set it to 10% of the sum of
@@ -2187,7 +2185,7 @@ static int cli_parse_shutdown_frontend(char **args, char *payload, struct appctx
        if (!px)
                return 1;
 
-       if (px->state == PR_STSTOPPED)
+       if (px->disabled)
                return cli_msg(appctx, LOG_NOTICE, "Frontend was already shut down.\n");
 
        ha_warning("Proxy %s stopped (cumulated conns: FE: %lld, BE: %lld).\n",
@@ -2215,7 +2213,7 @@ static int cli_parse_disable_frontend(char **args, char *payload, struct appctx
        if (!px)
                return 1;
 
-       if (px->state == PR_STSTOPPED)
+       if (px->disabled)
                return cli_msg(appctx, LOG_NOTICE, "Frontend was previously shut down, cannot disable.\n");
 
        if (!px->li_ready)
@@ -2247,7 +2245,7 @@ static int cli_parse_enable_frontend(char **args, char *payload, struct appctx *
        if (!px)
                return 1;
 
-       if (px->state == PR_STSTOPPED)
+       if (px->disabled)
                return cli_err(appctx, "Frontend was previously shut down, cannot enable.\n");
 
        if (px->li_ready == px->li_all)
index 4de4543b0aa655fb14a10ea67426caa04f8dc356..45b0f41216771ae3d89d48a8dcac2223c939362c 100644 (file)
@@ -4246,7 +4246,7 @@ struct server *cli_find_server(struct appctx *appctx, char *arg)
                return NULL;
        }
 
-       if (px->state == PR_STSTOPPED) {
+       if (px->disabled) {
                cli_err(appctx, "Proxy is disabled.\n");
                return NULL;
        }
index 132011d278d88f95f09288fa7195927ab0e98d94..033ed16e95eb56a2a447d70c019b3a87a5c46a1d 100644 (file)
@@ -1629,7 +1629,7 @@ int stats_fill_fe_stats(struct proxy *px, struct field *stats, int len)
        stats[ST_F_EREQ]     = mkf_u64(FN_COUNTER, px->fe_counters.failed_req);
        stats[ST_F_DCON]     = mkf_u64(FN_COUNTER, px->fe_counters.denied_conn);
        stats[ST_F_DSES]     = mkf_u64(FN_COUNTER, px->fe_counters.denied_sess);
-       stats[ST_F_STATUS]   = mkf_str(FO_STATUS, px->state == PR_STREADY ? "OPEN" : "STOP");
+       stats[ST_F_STATUS]   = mkf_str(FO_STATUS, px->disabled ? "STOP" : "OPEN");
        stats[ST_F_PID]      = mkf_u32(FO_KEY, relative_pid);
        stats[ST_F_IID]      = mkf_u32(FO_KEY|FS_SERVICE, px->uuid);
        stats[ST_F_SID]      = mkf_u32(FO_KEY|FS_SERVICE, 0);
@@ -3044,9 +3044,7 @@ static int stats_dump_proxies(struct stream_interface *si,
 
                px = appctx->ctx.stats.obj1;
                /* skip the disabled proxies, global frontend and non-networked ones */
-               if (px->state != PR_STSTOPPED && px->uuid > 0
-                   && (px->cap & (PR_CAP_FE | PR_CAP_BE))) {
-
+               if (!px->disabled && px->uuid > 0 && (px->cap & (PR_CAP_FE | PR_CAP_BE))) {
                        if (stats_dump_proxy_to_buffer(si, htx, px, uri) == 0)
                                return 0;
                }
@@ -3458,7 +3456,7 @@ static int stats_process_http_post(struct stream_interface *si)
                                                total_servers++;
                                                break;
                                        case ST_ADM_ACTION_SHUTDOWN:
-                                               if (px->state != PR_STSTOPPED) {
+                                               if (!px->disabled) {
                                                        srv_shutdown_streams(sv, SF_ERR_KILLED);
                                                        altered_servers++;
                                                        total_servers++;
index 69bd7adc5e97d66fb2aef20fe6c59f910e52429e..ff93e397cd02a1b2b00ecd41fb50cc29054f59fe 100644 (file)
@@ -640,7 +640,7 @@ int stktable_init(struct stktable *t)
                        t->exp_task->process = process_table_expire;
                        t->exp_task->context = (void *)t;
                }
-               if (t->peers.p && t->peers.p->peers_fe && t->peers.p->peers_fe->state != PR_STSTOPPED) {
+               if (t->peers.p && t->peers.p->peers_fe && !t->peers.p->peers_fe->disabled) {
                        peers_register_table(t->peers.p, t);
                }
 
index b298d7b79e888d82691671bf03e2966be42140e4..bcb9acf789e40a89cdb42de6c589b8b6c54d666e 100644 (file)
@@ -702,7 +702,7 @@ static void stream_free(struct stream *s)
        pool_free(pool_head_stream, s);
 
        /* We may want to free the maximum amount of pools if the proxy is stopping */
-       if (fe && unlikely(fe->state == PR_STSTOPPED)) {
+       if (fe && unlikely(fe->disabled)) {
                pool_flush(pool_head_buffer);
                pool_flush(pool_head_http_txn);
                pool_flush(pool_head_requri);