mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-20 00:10:41 -05:00
[BUG] session: release slot before processing pending connections
When a connection error is encountered on a server and the server's connection pool is full, pending connections are not woken up because the current connection is still accounted for on the server, so it still appears full. This becomes visible on a server which has "maxconn 1" because the pending connections will only be able to expire in the queue. Now we take care of releasing our current connection before trying to offer it to another pending request, so that the server can accept a next connection. This patch should be backported to 1.4.
This commit is contained in:
parent
32d3ee99ee
commit
b89cfca494
1 changed files with 3 additions and 0 deletions
|
|
@ -606,6 +606,7 @@ int sess_update_st_cer(struct session *s, struct stream_interface *si)
|
|||
if (s->srv)
|
||||
s->srv->counters.failed_conns++;
|
||||
s->be->counters.failed_conns++;
|
||||
sess_change_server(s, NULL);
|
||||
if (may_dequeue_tasks(s->srv, s->be))
|
||||
process_srv_queue(s->srv);
|
||||
|
||||
|
|
@ -628,6 +629,7 @@ int sess_update_st_cer(struct session *s, struct stream_interface *si)
|
|||
*/
|
||||
if (s->srv && si->conn_retries == 0 &&
|
||||
s->be->options & PR_O_REDISP && !(s->flags & SN_FORCE_PRST)) {
|
||||
sess_change_server(s, NULL);
|
||||
if (may_dequeue_tasks(s->srv, s->be))
|
||||
process_srv_queue(s->srv);
|
||||
|
||||
|
|
@ -740,6 +742,7 @@ void sess_update_stream_int(struct session *s, struct stream_interface *si)
|
|||
s->be->counters.failed_conns++;
|
||||
|
||||
/* release other sessions waiting for this server */
|
||||
sess_change_server(s, NULL);
|
||||
if (may_dequeue_tasks(s->srv, s->be))
|
||||
process_srv_queue(s->srv);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue