r2264 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Nov 20 12:11:17 CET 2007


Author: phk
Date: 2007-11-20 12:11:17 +0100 (Tue, 20 Nov 2007)
New Revision: 2264

Modified:
   trunk/varnish-cache/bin/varnishd/cache_backend_simple.c
Log:
When closing a backend connection, we can run into a ECONNRESET which
given circumstances is fair game.


Modified: trunk/varnish-cache/bin/varnishd/cache_backend_simple.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_simple.c	2007-11-20 11:07:47 UTC (rev 2263)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_simple.c	2007-11-20 11:11:17 UTC (rev 2264)
@@ -274,12 +274,14 @@
 static void
 bes_ClosedFd(struct worker *w, struct vbe_conn *vc)
 {
+	int i;
 
 	CHECK_OBJ_NOTNULL(vc, VBE_CONN_MAGIC);
 	CHECK_OBJ_NOTNULL(vc->backend, BACKEND_MAGIC);
 	assert(vc->fd >= 0);
 	WSL(w, SLT_BackendClose, vc->fd, "%s", vc->backend->vcl_name);
-	AZ(close(vc->fd));
+	i = close(vc->fd);
+	assert(i == 0 || errno == ECONNRESET);
 	vc->fd = -1;
 	VBE_DropRef(vc->backend);
 	vc->backend = NULL;




More information about the varnish-commit mailing list