mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 23:01:03 +01:00
BUG/MEDIUM: connections: Make sure we remove CO_FL_SESS_IDLE on disown.
When for some reason the session is not the owner of the connection anymore, make sure we remove CO_FL_SESS_IDLE, even if we're about to call conn->mux->destroy(), as the destroy may not destroy the connection immediately if it's still in use. This should be backported to 1.9. u
This commit is contained in:
parent
55071d30ca
commit
a48237fd07
@ -124,12 +124,12 @@ static inline int session_check_idle_conn(struct session *sess, struct connectio
|
|||||||
/* We can't keep the connection, let's try to add it to the server idle list */
|
/* We can't keep the connection, let's try to add it to the server idle list */
|
||||||
session_unown_conn(sess, conn);
|
session_unown_conn(sess, conn);
|
||||||
conn->owner = NULL;
|
conn->owner = NULL;
|
||||||
|
conn->flags &= ~CO_FL_SESS_IDLE;
|
||||||
if (!srv_add_to_idle_list(objt_server(conn->target), conn)) {
|
if (!srv_add_to_idle_list(objt_server(conn->target), conn)) {
|
||||||
/* The server doesn't want it, let's kill the connection right away */
|
/* The server doesn't want it, let's kill the connection right away */
|
||||||
conn->mux->destroy(conn->ctx);
|
conn->mux->destroy(conn->ctx);
|
||||||
return -1;
|
return -1;
|
||||||
} else
|
}
|
||||||
conn->flags &= ~CO_FL_SESS_IDLE;
|
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
conn->flags |= CO_FL_SESS_IDLE;
|
conn->flags |= CO_FL_SESS_IDLE;
|
||||||
|
|||||||
@ -1406,6 +1406,7 @@ int connect_server(struct stream *s)
|
|||||||
session_unown_conn(s->sess, old_conn);
|
session_unown_conn(s->sess, old_conn);
|
||||||
old_conn->owner = sess;
|
old_conn->owner = sess;
|
||||||
if (!session_add_conn(sess, old_conn, old_conn->target)) {
|
if (!session_add_conn(sess, old_conn, old_conn->target)) {
|
||||||
|
old_conn->flags &= ~CO_FL_SESS_IDLE;
|
||||||
old_conn->owner = NULL;
|
old_conn->owner = NULL;
|
||||||
old_conn->mux->destroy(old_conn->ctx);
|
old_conn->mux->destroy(old_conn->ctx);
|
||||||
} else
|
} else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user