Skip to content
Snippets Groups Projects
Commit 9bce8696 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Suppress writing ECONNRESET to the log, this typically happens on client timeout.

parent a7944f31
No related branches found
No related tags found
No related merge requests found
......@@ -231,9 +231,27 @@ ssize_t
sio_read(int fd, void *buf, size_t count)
{
ssize_t n = read(fd, buf, count);
if (n < 0 && errno != EAGAIN &&
errno != EWOULDBLOCK && errno != EINTR)
if (n < 0) {
if (errno == EWOULDBLOCK)
errno = EINTR;
switch (errno) {
case EAGAIN:
case EINTR:
break;
/*
* Happens typically when the client closes
* socket on timeout without reading the previous
* query's response completely. Treat the same as
* EOF.
*/
case ECONNRESET:
errno = 0;
n = 0;
break;
default:
tnt_raise(SocketError, fd, "read(%zd)", count);
}
}
return n;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment