mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-05 04:56:10 +02:00
BUG/MEDIUM: checks: immediately report a connection success
When no check type is configured (so the basic connection check), we want the connection success to be immediately reported. Unfortunately, it did not happen because in this case the connection is not registered for read nor for write, and the wake_srv() callback does not handle this case where no data transfer was requested. However, having option tcp-check hides this problem because the check type follows a different setup mode, by having check->type != 0 and the connection believing it must try to send data. The effect was that without any option, checks would succeed only at the end of the check interval. So let's just add the wake-up condition. This bug appeared with the recent polling changes, no backport is needed. As a workaround, using "option tcp-check" fixes the problem.
This commit is contained in:
parent
96a7785429
commit
3be293f4a3
@ -1449,6 +1449,13 @@ static int wake_srv_chk(struct connection *conn)
|
||||
__conn_data_stop_both(conn);
|
||||
task_wakeup(check->task, TASK_WOKEN_IO);
|
||||
}
|
||||
else if (!(conn->flags & (CO_FL_DATA_RD_ENA|CO_FL_DATA_WR_ENA|CO_FL_HANDSHAKE))) {
|
||||
/* we may get here if only a connection probe was required : we
|
||||
* don't have any data to send nor anything expected in response,
|
||||
* so the completion of the connection establishment is enough.
|
||||
*/
|
||||
task_wakeup(check->task, TASK_WOKEN_IO);
|
||||
}
|
||||
|
||||
if (check->result != CHK_RES_UNKNOWN) {
|
||||
/* We're here because nobody wants to handle the error, so we
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user