Cleanup the STATID_CONNECT and STATID_CONNECTFAIL stat counters
The STATID_CONNECT and STATID_CONNECTFAIL statistics were used
incorrectly. The STATID_CONNECT was incremented twice (once in
the *_connect_direct() and once in the callback) and STATID_CONNECTFAIL
would not be incremented at all if the failure happened in the callback.
Closes: #3452
(cherry picked from commit 59e1703b50)
This commit is contained in:
@@ -1963,6 +1963,8 @@ isc__nm_failed_connect_cb(isc_nmsocket_t *sock, isc__nm_uvreq_t *req,
|
||||
REQUIRE(sock->tid == isc_nm_tid());
|
||||
REQUIRE(req->cb.connect != NULL);
|
||||
|
||||
isc__nm_incstats(sock, STATID_CONNECTFAIL);
|
||||
|
||||
isc__nmsocket_timer_stop(sock);
|
||||
uv_handle_set_data((uv_handle_t *)&sock->read_timer, sock);
|
||||
|
||||
|
||||
@@ -166,7 +166,6 @@ tcp_connect_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) {
|
||||
isc__nm_incstats(sock, STATID_CONNECTFAIL);
|
||||
goto done;
|
||||
}
|
||||
isc__nm_incstats(sock, STATID_CONNECT);
|
||||
|
||||
uv_handle_set_data((uv_handle_t *)&sock->read_timer,
|
||||
&req->uv_req.connect);
|
||||
@@ -220,7 +219,7 @@ isc__nm_async_tcpconnect(isc__networker_t *worker, isc__netievent_t *ev0) {
|
||||
|
||||
static void
|
||||
tcp_connect_cb(uv_connect_t *uvreq, int status) {
|
||||
isc_result_t result;
|
||||
isc_result_t result = ISC_R_UNSET;
|
||||
isc__nm_uvreq_t *req = NULL;
|
||||
isc_nmsocket_t *sock = uv_handle_get_data((uv_handle_t *)uvreq->handle);
|
||||
struct sockaddr_storage ss;
|
||||
@@ -267,7 +266,6 @@ tcp_connect_cb(uv_connect_t *uvreq, int status) {
|
||||
&sock->uv_handle.tcp,
|
||||
&req->peer.type.sa, tcp_connect_cb);
|
||||
if (r != 0) {
|
||||
isc__nm_incstats(sock, STATID_CONNECTFAIL);
|
||||
result = isc__nm_uverr2result(r);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,6 @@ tcpdns_connect_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) {
|
||||
isc__nm_incstats(sock, STATID_CONNECTFAIL);
|
||||
goto done;
|
||||
}
|
||||
isc__nm_incstats(sock, STATID_CONNECT);
|
||||
|
||||
uv_handle_set_data((uv_handle_t *)&sock->read_timer,
|
||||
&req->uv_req.connect);
|
||||
@@ -190,7 +189,7 @@ isc__nm_async_tcpdnsconnect(isc__networker_t *worker, isc__netievent_t *ev0) {
|
||||
|
||||
static void
|
||||
tcpdns_connect_cb(uv_connect_t *uvreq, int status) {
|
||||
isc_result_t result;
|
||||
isc_result_t result = ISC_R_UNSET;
|
||||
isc__nm_uvreq_t *req = NULL;
|
||||
isc_nmsocket_t *sock = uv_handle_get_data((uv_handle_t *)uvreq->handle);
|
||||
struct sockaddr_storage ss;
|
||||
@@ -230,7 +229,6 @@ tcpdns_connect_cb(uv_connect_t *uvreq, int status) {
|
||||
&req->uv_req.connect, &sock->uv_handle.tcp,
|
||||
&req->peer.type.sa, tcpdns_connect_cb);
|
||||
if (r != 0) {
|
||||
isc__nm_incstats(sock, STATID_CONNECTFAIL);
|
||||
result = isc__nm_uverr2result(r);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,6 @@ tlsdns_connect_direct(isc_nmsocket_t *sock, isc__nm_uvreq_t *req) {
|
||||
isc__nm_incstats(sock, STATID_CONNECTFAIL);
|
||||
goto done;
|
||||
}
|
||||
isc__nm_incstats(sock, STATID_CONNECT);
|
||||
|
||||
uv_handle_set_data((uv_handle_t *)&sock->read_timer,
|
||||
&req->uv_req.connect);
|
||||
@@ -230,7 +229,7 @@ isc__nm_async_tlsdnsconnect(isc__networker_t *worker, isc__netievent_t *ev0) {
|
||||
|
||||
static void
|
||||
tlsdns_connect_cb(uv_connect_t *uvreq, int status) {
|
||||
isc_result_t result;
|
||||
isc_result_t result = ISC_R_UNSET;
|
||||
isc__nm_uvreq_t *req = NULL;
|
||||
isc_nmsocket_t *sock = uv_handle_get_data((uv_handle_t *)uvreq->handle);
|
||||
struct sockaddr_storage ss;
|
||||
@@ -270,7 +269,6 @@ tlsdns_connect_cb(uv_connect_t *uvreq, int status) {
|
||||
&req->uv_req.connect, &sock->uv_handle.tcp,
|
||||
&req->peer.type.sa, tlsdns_connect_cb);
|
||||
if (r != 0) {
|
||||
isc__nm_incstats(sock, STATID_CONNECTFAIL);
|
||||
result = isc__nm_uverr2result(r);
|
||||
goto error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user