[4.1] 57cb059 Another VCA shutdown race.

Lasse Karstensen lkarsten at varnish-software.com
Thu Feb 11 17:14:33 CET 2016


commit 57cb0598f1b7d620db99fe45e759142b84072077
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 8 10:40:44 2016 +0000

    Another VCA shutdown race.

diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index e983dca..4fa62eb 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -405,6 +405,12 @@ vca_accept_task(struct worker *wrk, void *arg)
 				   &wa.acceptaddrlen);
 		} while (i < 0 && errno == EAGAIN);
 
+		if (i < 0 && ls->sock == -2) {
+			/* Shut down in progress */
+			sleep(2);
+			continue;
+		}
+
 		if (i < 0) {
 			switch (errno) {
 			case ECONNABORTED:
@@ -416,7 +422,8 @@ vca_accept_task(struct worker *wrk, void *arg)
 			case EBADF:
 				VSL(SLT_Debug, ls->sock, "Accept failed: %s",
 				    strerror(errno));
-				return;
+				vca_pace_bad();
+				break;
 			default:
 				VSL(SLT_Debug, ls->sock, "Accept failed: %s",
 				    strerror(errno));



More information about the varnish-commit mailing list