[BUG] reset the stream_interface connect timeout upon connect or error

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.
This commit is contained in:
Willy Tarreau 2009-03-28 10:47:26 +01:00
parent 8019ffa0ca
commit 127334e89b
2 changed files with 9 additions and 2 deletions

View 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 @@ struct task *process_session(struct task *t)
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

View 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);