r4511 - trunk/varnish-cache/bin/varnishtest

phk at projects.linpro.no phk at projects.linpro.no
Fri Jan 29 11:39:41 CET 2010


Author: phk
Date: 2010-01-29 11:39:41 +0100 (Fri, 29 Jan 2010)
New Revision: 4511

Modified:
   trunk/varnish-cache/bin/varnishtest/vtc.c
Log:
Document why we don't clean up in case of a timeout



Modified: trunk/varnish-cache/bin/varnishtest/vtc.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc.c	2010-01-29 09:56:01 UTC (rev 4510)
+++ trunk/varnish-cache/bin/varnishtest/vtc.c	2010-01-29 10:39:41 UTC (rev 4511)
@@ -516,16 +516,22 @@
 	AZ(pthread_create(&pt, NULL, exec_file_thread, &pe));
 	i = pthread_cond_timedwait(&vtc_cond, &vtc_mtx, &ts);
 
-	if (i == ETIMEDOUT)  {
-		// AZ(pthread_cancel(pt));
-		// AZ(pthread_join(pt, &v));
-		vtc_log(vltop, 1, "Test timed out");
-		vtc_error = 1;
-	} else if (i == 0) {
+	if (i == 0) {
 		AZ(pthread_mutex_unlock(&vtc_mtx));
 		AZ(pthread_join(pt, &v));
 	} else {
-		vtc_log(vltop, 1, "Weird return: %d %s", i, strerror(i));
+		if (i != ETIMEDOUT)
+			vtc_log(vltop, 1, "Weird condwait return: %d %s",
+			    i, strerror(i));
+		/*
+		 * We are all going to die anyway, so don't waste time
+		 * trying to clean things up, it seems to trigger a
+		 * problem in the tinderbox
+		 *   AZ(pthread_mutex_unlock(&vtc_mtx));
+		 *   AZ(pthread_cancel(pt));
+		 *   AZ(pthread_join(pt, &v));
+		 */
+		vtc_log(vltop, 1, "Test timed out");
 		vtc_error = 1;
 	}
 



More information about the varnish-commit mailing list