[master] 7d31cc7 Set socket non-blocking before closing, if we are load-shedding it.

Poul-Henning Kamp phk at FreeBSD.org
Tue Feb 9 01:19:11 CET 2016


commit 7d31cc7708bfd42c982a730a53547c30b61468cb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 8 20:29:09 2016 +0000

    Set socket non-blocking before closing, if we are load-shedding it.

diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index 328a64d..5588082 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -313,9 +313,10 @@ vca_make_session(struct worker *wrk, void *arg)
 		 * connection with minimum effort and fuzz, rather than try
 		 * to send an intelligent message back.
 		 */
+		vca_pace_bad();
+		(void)VTCP_nonblocking(wa->acceptsock);
 		AZ(close(wa->acceptsock));
 		wrk->stats->sess_drop++;
-		vca_pace_bad();
 		WS_Release(wrk->aws, 0);
 		return;
 	}



More information about the varnish-commit mailing list