From: Willy Tarreau Date: Wed, 11 Jun 2014 12:11:44 +0000 (+0200) Subject: BUG/MEDIUM: http: clear CF_READ_NOEXP when preparing a new transaction X-Git-Tag: v1.5.0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77d29029af1c44216b190dd7442964b9d8f45257;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: http: clear CF_READ_NOEXP when preparing a new transaction Commit b1982e2 ("BUG/MEDIUM: http/session: disable client-side expiration only after body") was tricky and caused an issue which was fixed by commit 0943757 ("BUG/MEDIUM: session: don't clear CF_READ_NOEXP if analysers are not called"). But that's not enough, another issue was introduced and further emphasized by last fix. The issue is that the CF_READ_NOEXP flag needs to be cleared when waiting for a new request over that connection, otherwise we cannot expire anymore an idle connection waiting for a new request. This explains the neverending keepalives reported by at least 3 different persons since dev24. No backport is needed. --- diff --git a/src/proto_http.c b/src/proto_http.c index b833cfc01e..160c4a7604 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -4754,8 +4754,8 @@ void http_end_txn_clean_session(struct session *s) s->req->cons->conn_retries = 0; /* used for logging too */ s->req->cons->exp = TICK_ETERNITY; s->req->cons->flags &= SI_FL_DONT_WAKE; /* we're in the context of process_session */ - s->req->flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WAKE_CONNECT); - s->rep->flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT); + s->req->flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WAKE_CONNECT|CF_READ_NOEXP); + s->rep->flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT|CF_READ_NOEXP); s->flags &= ~(SN_DIRECT|SN_ASSIGNED|SN_ADDR_SET|SN_BE_ASSIGNED|SN_FORCE_PRST|SN_IGNORE_PRST); s->flags &= ~(SN_CURR_SESS|SN_REDIRECTABLE|SN_SRV_REUSED);