mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-20 04:37:04 +00:00
[BUG] increment server connections for each connect()
It was abnormal to see more connect errors than connect attempts. This was caused by the fact that the server's connection count was not incremented for failed connect() attempts. Now the per-server connections are correctly incremented for each connect() attempt. This includes the retries too. The number of connections effectively served by a server will then be : srv->cum_sess - srv->errors - srv->warnings
This commit is contained in:
parent
51c9bde060
commit
98937b8757
@ -1356,6 +1356,8 @@ int srv_count_retry_down(struct session *t, int conn_err)
|
||||
tv_eternity(&t->req->cex);
|
||||
srv_close_with_err(t, conn_err, SN_FINST_C,
|
||||
503, error_message(t, HTTP_ERR_503));
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
if (t->srv)
|
||||
t->srv->failed_conns++;
|
||||
t->be->failed_conns++;
|
||||
@ -1392,12 +1394,16 @@ int srv_retryable_connect(struct session *t)
|
||||
case SN_ERR_NONE:
|
||||
//fprintf(stderr,"0: c=%d, s=%d\n", c, s);
|
||||
t->srv_state = SV_STCONN;
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
return 1;
|
||||
|
||||
case SN_ERR_INTERNAL:
|
||||
tv_eternity(&t->req->cex);
|
||||
srv_close_with_err(t, SN_ERR_INTERNAL, SN_FINST_C,
|
||||
500, error_message(t, HTTP_ERR_500));
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
if (t->srv)
|
||||
t->srv->failed_conns++;
|
||||
t->be->failed_conns++;
|
||||
@ -1419,6 +1425,8 @@ int srv_retryable_connect(struct session *t)
|
||||
if (may_dequeue_tasks(t->srv, t->be))
|
||||
task_wakeup(t->srv->queue_mgt);
|
||||
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
if (t->srv)
|
||||
t->srv->failed_conns++;
|
||||
t->be->redispatches++;
|
||||
@ -1455,6 +1463,8 @@ int srv_redispatch_connect(struct session *t)
|
||||
tv_eternity(&t->req->cex);
|
||||
srv_close_with_err(t, SN_ERR_SRVTO, SN_FINST_C,
|
||||
503, error_message(t, HTTP_ERR_503));
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
if (t->srv)
|
||||
t->srv->failed_conns++;
|
||||
t->be->failed_conns++;
|
||||
@ -1475,6 +1485,8 @@ int srv_redispatch_connect(struct session *t)
|
||||
tv_eternity(&t->req->cex);
|
||||
srv_close_with_err(t, SN_ERR_INTERNAL, SN_FINST_C,
|
||||
500, error_message(t, HTTP_ERR_500));
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
if (t->srv)
|
||||
t->srv->failed_conns++;
|
||||
t->be->failed_conns++;
|
||||
|
@ -2507,6 +2507,8 @@ int process_srv(struct session *t)
|
||||
if (may_dequeue_tasks(t->srv, t->be))
|
||||
task_wakeup(t->srv->queue_mgt);
|
||||
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
if (t->srv)
|
||||
t->srv->failed_conns++;
|
||||
t->be->redispatches++;
|
||||
@ -2560,8 +2562,6 @@ int process_srv(struct session *t)
|
||||
tv_eternity(&rep->rex);
|
||||
|
||||
t->srv_state = SV_STDATA;
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
rep->rlim = rep->data + BUFSIZE; /* no rewrite needed */
|
||||
|
||||
/* if the user wants to log as soon as possible, without counting
|
||||
@ -2579,8 +2579,6 @@ int process_srv(struct session *t)
|
||||
}
|
||||
else {
|
||||
t->srv_state = SV_STHEADERS;
|
||||
if (t->srv)
|
||||
t->srv->cum_sess++;
|
||||
rep->rlim = rep->data + BUFSIZE - MAXREWRITE; /* rewrite needed */
|
||||
t->txn.rsp.msg_state = HTTP_MSG_RPBEFORE;
|
||||
/* reset hdr_idx which was already initialized by the request.
|
||||
|
Loading…
Reference in New Issue
Block a user