Commit be694992 authored by Nils Goroll's avatar Nils Goroll

log accept failures under the SessError tag

I consider it too late for a vtc, but this has been tested manually
with ulimit -n 40. Example errors (tcp, uds)

         0 SessError      - a0 127.0.0.1 8080 3 24 Too many open files
	 0 SessError      - a1 0.0.0.0 0 5 24 Too many open files
parent 5275550c
......@@ -451,6 +451,8 @@ vca_accept_task(struct worker *wrk, void *arg)
struct poolsock *ps;
struct listen_sock *ls;
int i;
char laddr[VTCP_ADDRBUFSIZE];
char lport[VTCP_PORTBUFSIZE];
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CAST_OBJ_NOTNULL(ps, arg, POOLSOCK_MAGIC);
......@@ -510,9 +512,21 @@ vca_accept_task(struct worker *wrk, void *arg)
vca_pace_bad();
break;
}
i = errno;
wrk->stats->sess_fail++;
VSL(SLT_Debug, ls->sock, "Accept failed: %s",
strerror(errno));
if (wa.acceptlsock->uds) {
strcpy(laddr, "0.0.0.0");
strcpy(lport, "0");
} else {
VTCP_myname(ls->sock, laddr, VTCP_ADDRBUFSIZE,
lport, VTCP_ADDRBUFSIZE);
}
VSL(SLT_SessError, 0, "%s %s %s %d %d %s",
wa.acceptlsock->name, laddr, lport,
ls->sock, i, strerror(i));
(void)Pool_TrySumstat(wrk);
continue;
}
......
......@@ -183,6 +183,12 @@ Other changes
In particular, http connection (HTC) errors are now reported
symbolically in addition to the previous numerical value.
* Log entries under the new ``SessError`` tag now give more
diagnostic information about session accept failures (failure to
accept a client connection). These must be viewed in raw grouping,
since accept failures are not part of any request/response
transaction.
* When a backend is unhealthy, ``Backend_health`` now reports some
diagnostic information in addition to the HTTP response and timing
information.
......
......@@ -65,6 +65,20 @@ SLTM(CLI, 0, "CLI communication",
/*---------------------------------------------------------------------*/
SLTM(SessError, 0, "Client connection accept failed",
"Accepting a client connection has failed.\n\n"
"The format is::\n\n"
"\t%s %s %s %d %d %s\n"
"\t| | | | | |\n"
"\t| | | | | +- Detailed error message\n"
"\t| | | | +---- Error Number (errno) from accept(2)\n"
"\t| | | +------- File descriptor number\n"
"\t| | +---------- Local TCP port\n"
"\t| +------------- Local IPv4/6 address\n"
"\t+---------------- Socket name (from -a argument)\n"
"\n"
)
SLTM(SessOpen, 0, "Client connection opened",
"The first record for a client connection, with the socket-endpoints"
" of the connection.\n\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment