Commit b499af9c authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Stop accept() timeouts from being counted as sess_fail in varnishstat

Varnish sets SO_RCVTIMEO to cache_param->timeout_idle on the listen
sockets, so that the value is inherited to the accept()ed
connections. This has the side effect of making accept() returning
with EAGAIN after cache_param->timeout_idle seconds when there are no
connections coming in, and each of these timeouts is counted as a
sess_failed. Also the pacing sleep time is increased for each of these
timeouts, causing Varnish to react slowly at first when connections
start coming in.

Patch changes to loop around the call to accept() while EAGAIN
parent bf913ad2
......@@ -186,7 +186,10 @@ VCA_Accept(struct listen_sock *ls, struct wrk_accept *wa)
(void)usleep(100*1000);
wa->acceptaddrlen = sizeof wa->acceptaddr;
i = accept(ls->sock, (void*)&wa->acceptaddr, &wa->acceptaddrlen);
do {
i = accept(ls->sock, (void*)&wa->acceptaddr,
&wa->acceptaddrlen);
} while (i < 0 && errno == EAGAIN);
if (i < 0) {
switch (errno) {
......
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