]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] do not release the connection slot during a retry
authorWilly Tarreau <w@1wt.eu>
Sun, 14 Sep 2008 15:40:09 +0000 (17:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 14 Sep 2008 16:19:11 +0000 (18:19 +0200)
A bug was introduced during last queue management fix. If a server
connection fails, the allocated connection slot is released, but it
will be needed again after the turn-around. This also causes more
connections than expected to go to the server because it appears to
have less connections than real.

Many thanks to Rupert Fiasco, Mark Imbriaco, Cody Fauser, Brian
Gupta and Alexander Staubo for promptly providing configuration
and diagnosis elements to help reproduce this problem easily.

(cherry picked from commit 8262d8bd7fdb262c980bd70cb2931e51df07513f)

src/proto_http.c

index 81ac57bf99781c782119ee5e4c52b3eefc6297f3..eef6267551e0b391698cf536698ba3de2c49c6fa 100644 (file)
@@ -2494,10 +2494,8 @@ int process_srv(struct session *t)
                        //fprintf(stderr,"2: c=%d, s=%d\n", c, s);
 
                        fd_delete(t->srv_fd);
-                       if (t->srv) {
+                       if (t->srv)
                                t->srv->cur_sess--;
-                               sess_change_server(t, NULL);
-                       }
 
                        if (!(req->flags & BF_WRITE_STATUS))
                                conn_err = SN_ERR_SRVTO; // it was a connect timeout.