Skip to content

Don't increment network error stats on UV_EOF

Matthijs Mekking requested to merge 2208-tcp4recverr-stat-miscount-v9_16 into v9_16

When networking statistics was added to the netmgr (in commit 5234a8e0), two lines were added that increment the 'STATID_RECVFAIL' statistic: One if 'uv_read_start' fails and one at the end of the 'read_cb'. The latter happens if 'nread < 0'.

According to the libuv documentation, I/O read callbacks (such as for files and sockets) are passed a parameter 'nread'. If 'nread' is less than 0, there was an error and 'UV_EOF' is the end of file error, which you may want to handle differently.

In other words, we should not treat EOF as a RECVFAIL error.

(cherry picked from commit 6c5ff942)

Closes #2208 (closed)

Merge request reports