diff --git a/src/checks.c b/src/checks.c index d91e23922..ff39b4f64 100644 --- a/src/checks.c +++ b/src/checks.c @@ -941,6 +941,10 @@ static void __event_srv_chk_r(struct conn_stream *cs) if (!done && b_data(&check->bi) < strlen("000\r")) goto wait_more_data; + /* do not reset when closing, servers don't like this */ + if (conn_ctrl_ready(cs->conn)) + fdtab[cs->conn->handle.fd].linger_risk = 0; + /* Check if the server speaks SMTP */ if ((b_data(&check->bi) < strlen("000\r")) || (*(b_head(&check->bi) + 3) != ' ' && *(b_head(&check->bi) + 3) != '\r') || @@ -1174,6 +1178,10 @@ static void __event_srv_chk_r(struct conn_stream *cs) if (!done && b_data(&check->bi) < 9) goto wait_more_data; + /* do not reset when closing, servers don't like this */ + if (conn_ctrl_ready(cs->conn)) + fdtab[cs->conn->handle.fd].linger_risk = 0; + if (b_head(&check->bi)[0] == 'R') { set_server_check_status(check, HCHK_STATUS_L7OKD, "PostgreSQL server is ok"); } @@ -1203,6 +1211,10 @@ static void __event_srv_chk_r(struct conn_stream *cs) if (!done && b_data(&check->bi) < 5) goto wait_more_data; + /* do not reset when closing, servers don't like this */ + if (conn_ctrl_ready(cs->conn)) + fdtab[cs->conn->handle.fd].linger_risk = 0; + if (s->proxy->check_len == 0) { // old mode if (*(b_head(&check->bi) + 4) != '\xff') { /* We set the MySQL Version in description for information purpose