r4308 - branches/2.0/varnish-cache/bin/varnishd

tfheen at projects.linpro.no tfheen at projects.linpro.no
Thu Oct 8 16:29:34 CEST 2009


Author: tfheen
Date: 2009-10-08 16:29:34 +0200 (Thu, 08 Oct 2009)
New Revision: 4308

Modified:
   branches/2.0/varnish-cache/bin/varnishd/cache_expire.c
   branches/2.0/varnish-cache/bin/varnishd/cache_vcl.c
Log:
Merge r4195: Avoid the 10 second sleep while waiting for the VCL to appear.



Modified: branches/2.0/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_expire.c	2009-10-08 14:22:17 UTC (rev 4307)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_expire.c	2009-10-08 14:29:34 UTC (rev 4308)
@@ -282,7 +282,6 @@
 	double t;
 
 	(void)priv;
-	AZ(sleep(10));		/* XXX: Takes time for VCL to arrive */
 	VCL_Get(&sp->vcl);
 	t = TIM_real();
 	while (1) {

Modified: branches/2.0/varnish-cache/bin/varnishd/cache_vcl.c
===================================================================
--- branches/2.0/varnish-cache/bin/varnishd/cache_vcl.c	2009-10-08 14:22:17 UTC (rev 4307)
+++ branches/2.0/varnish-cache/bin/varnishd/cache_vcl.c	2009-10-08 14:29:34 UTC (rev 4308)
@@ -83,7 +83,13 @@
 void
 VCL_Get(struct VCL_conf **vcc)
 {
+	static int once;
 
+	while (!once && vcl_active == NULL) {
+		sleep(1);
+	}
+	once = 1;
+
 	Lck_Lock(&vcl_mtx);
 	AN(vcl_active);
 	*vcc = vcl_active->conf;



More information about the varnish-commit mailing list