]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] reset the stream_interface connect timeout upon connect or error
authorWilly Tarreau <w@1wt.eu>
Sat, 28 Mar 2009 09:47:26 +0000 (10:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 28 Mar 2009 10:01:20 +0000 (11:01 +0100)
The stream_interface timeout was not reset upon a connect success or
error, leading to busy loops when requeuing tasks in the past.

Thanks to Bart Bobrowski for reporting the issue.

src/session.c
src/stream_sock.c

index 9c06065f5b6072be31649c86ae9f3903e97d5707..659dadb5be3e3908e34ebbf87ffd2ab70f8bb493 100644 (file)
@@ -182,6 +182,7 @@ int sess_update_st_con_tcp(struct session *s, struct stream_interface *si)
         * attempts and error reports.
         */
        if (unlikely(si->flags & (SI_FL_EXP|SI_FL_ERR))) {
+               si->exp   = TICK_ETERNITY;
                si->state = SI_ST_CER;
                fd_delete(si->fd);
 
@@ -219,6 +220,7 @@ int sess_update_st_con_tcp(struct session *s, struct stream_interface *si)
         * responsible for handling the transition from CON to EST.
         */
        s->logs.t_connect = tv_ms_elapsed(&s->logs.tv_accept, &now);
+       si->exp      = TICK_ETERNITY;
        si->state    = SI_ST_EST;
        si->err_type = SI_ET_NONE;
        si->err_loc  = NULL;
@@ -1127,8 +1129,11 @@ resync_stream_interface:
                        t->expire = tick_first(t->expire, s->si[1].exp);
 
 #ifdef DEBUG_FULL
-               fprintf(stderr, "[%u] queuing with exp=%u req->rex=%u req->wex=%u req->ana_exp=%u rep->rex=%u rep->wex=%u, cs=%d, ss=%d\n",
-                       now_ms, t->expire, s->req->rex, s->req->wex, s->req->analyse_exp, s->rep->rex, s->rep->wex, s->si[0].state, s->si[1].state);
+               fprintf(stderr,
+                       "[%u] queuing with exp=%u req->rex=%u req->wex=%u req->ana_exp=%u"
+                       " rep->rex=%u rep->wex=%u, si[0].exp=%u, si[1].exp=%u, cs=%d, ss=%d\n",
+                       now_ms, t->expire, s->req->rex, s->req->wex, s->req->analyse_exp,
+                       s->rep->rex, s->rep->wex, s->si[0].exp, s->si[1].exp, s->si[0].state, s->si[1].state);
 #endif
 
 #ifdef DEBUG_DEV
index 83c3c8840945e892fe49605e96fcc4f2d0139611..30d6b6227523cd36994fb8a42d491350f814035d 100644 (file)
@@ -795,6 +795,7 @@ void stream_sock_shutw(struct stream_interface *si)
        default:
                si->ib->flags |= BF_SHUTR;
                si->ib->rex = TICK_ETERNITY;
+               si->exp = TICK_ETERNITY;
                return;
        }
 }
@@ -819,6 +820,7 @@ void stream_sock_shutr(struct stream_interface *si)
        if (si->ob->flags & BF_SHUTW) {
                fd_delete(si->fd);
                si->state = SI_ST_DIS;
+               si->exp = TICK_ETERNITY;
                return;
        }
        EV_FD_CLR(si->fd, DIR_RD);