Merge branch '2208-tcp4recverr-stat-miscount-v9_16' into 'v9_16'

Don't increment network error stats on UV_EOF

See merge request isc-projects/bind9!4277
This commit is contained in:
Matthijs Mekking
2020-10-21 06:34:19 +00:00
4 changed files with 35 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
5517. [bug] Handle 'UV_EOF' differently and don't contribute it to
the RECVFAIL statistic count. [GL #2208]
5516. [func] The default EDNS buffer size has been changed from 4096
to 1232. [GL #2183]

View File

@@ -162,6 +162,8 @@ if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ] ; th
${CURL} http://10.53.0.3:${EXTRAPORT1}/xml/v3 > curl.out.${n}.xml 2>/dev/null || ret=1
${CURL} http://10.53.0.3:${EXTRAPORT1}/bind9.xsl > curl.out.${n}.xsl 2>/dev/null || ret=1
${XSLTPROC} curl.out.${n}.xsl - < curl.out.${n}.xml > xsltproc.out.${n} 2>/dev/null || ret=1
cp curl.out.${n}.xml stats.xml.out || ret=1
#
# grep for expected sections.
#
@@ -206,6 +208,30 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
ret=0
echo_i "checking bind9.xml socket statistics ($n)"
if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ] ; then
# Socket statistics (expect no errors)
grep "<counter name=\"TCP4AcceptFail\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP4BindFail\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP4ConnFail\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP4OpenFail\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP4RecvErr\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP4SendErr\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP6AcceptFail\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP6BindFail\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP6ConnFail\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP6OpenFail\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP6RecvErr\">0</counter>" stats.xml.out >/dev/null || ret=1
grep "<counter name=\"TCP6SendErr\">0</counter>" stats.xml.out >/dev/null || ret=1
else
echo_i "skipping test as libxml2 and/or curl and/or xsltproc was not found"
fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
ret=0
echo_i "checking priming queries are counted ($n)"
grep "1 priming queries" ns3/named.stats

View File

@@ -67,3 +67,6 @@ Bug Fixes
- `named` would start continous rollovers for policies that algorithms
Ed25519 or Ed448 due to a mismatch in created key size and expected key size.
[GL #2171]
- Handle `UV_EOF` differently such that it is not treated as a `TCP4RecvErr` or
`TCP6RecvErr`. [GL #2208]

View File

@@ -803,8 +803,10 @@ read_cb(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
* This might happen if the inner socket is closing. It means that
* it's detached, so the socket will be closed.
*/
if (cb != NULL) {
if (nread != UV_EOF) {
isc__nm_incstats(sock->mgr, sock->statsindex[STATID_RECVFAIL]);
}
if (cb != NULL) {
isc__nmsocket_clearcb(sock);
cb(sock->statichandle, ISC_R_EOF, NULL, cbarg);
}