diff --git a/CHANGES b/CHANGES index 71704f18b0..4d81ce8f18 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +6391. [bug] TCP client statistics could sometimes fail to decrease + when accepting client connection fails. [GL #4742] + 6390. [bug] Fix a data race in isc_task_purgeevent(). [GL !8937] 6389. [bug] dnssec-verify and dnssec-signzone could fail if there diff --git a/doc/arm/reference.rst b/doc/arm/reference.rst index 48dbce13b7..88faad4023 100644 --- a/doc/arm/reference.rst +++ b/doc/arm/reference.rst @@ -8244,3 +8244,6 @@ exceptions are noted in the descriptions. ``RecvErr`` This indicates the number of errors in socket receive operations, including errors of send operations on a connected UDP socket, notified by an ICMP error message. + +``TCP4Clients``/``TCP6Clients`` + This indicates the number of IPv4/IPv6 clients currently connected over TCP. diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index 52d0cec18a..f0101b9833 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -43,6 +43,10 @@ Bug Fixes :iscman:`named` could crash with an assertion failure. This has been fixed. :gl:`#4719` +- The statistics channel counters that indicated the number of currently + connected TCP IPv4/IPv6 clients were not properly adjusted in certain + failure scenarios. This has been fixed. :gl:`#4742` + Known Issues ~~~~~~~~~~~~ diff --git a/lib/isc/netmgr/tcpdns.c b/lib/isc/netmgr/tcpdns.c index 1864a45aba..dd3e9ec3fe 100644 --- a/lib/isc/netmgr/tcpdns.c +++ b/lib/isc/netmgr/tcpdns.c @@ -1005,8 +1005,6 @@ accept_connection(isc_nmsocket_t *ssock, isc_quota_t *quota) { UV_RUNTIME_CHECK(uv_timer_init, r); uv_handle_set_data((uv_handle_t *)&csock->read_timer, csock); - isc__nm_incstats(csock, STATID_CLIENTS); - r = uv_accept(&ssock->uv_handle.stream, &csock->uv_handle.stream); if (r != 0) { result = isc__nm_uverr2result(r); @@ -1084,6 +1082,8 @@ accept_connection(isc_nmsocket_t *ssock, isc_quota_t *quota) { isc_nmhandle_detach(&handle); + isc__nm_incstats(csock, STATID_CLIENTS); + /* * sock is now attached to the handle. */ diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index 7a005db9b9..fa416e2fef 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -1629,8 +1629,6 @@ accept_connection(isc_nmsocket_t *ssock, isc_quota_t *quota) { UV_RUNTIME_CHECK(uv_timer_init, r); uv_handle_set_data((uv_handle_t *)&csock->read_timer, csock); - isc__nm_incstats(csock, STATID_CLIENTS); - r = uv_accept(&ssock->uv_handle.stream, &csock->uv_handle.stream); if (r != 0) { result = isc__nm_uverr2result(r); @@ -1727,6 +1725,8 @@ accept_connection(isc_nmsocket_t *ssock, isc_quota_t *quota) { goto failure; } + isc__nm_incstats(csock, STATID_CLIENTS); + /* * sock is now attached to the handle. */