[master] 70d2425c5 VDI_Resolve() should not return a director which is admin-unhealthy

Nils Goroll nils.goroll at uplex.de
Mon Mar 4 16:22:07 UTC 2019


commit 70d2425c597641bc241554ed010177791eec9daf
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Mar 4 17:18:52 2019 +0100

    VDI_Resolve() should not return a director which is admin-unhealthy
    
    Implicitly fixes the same issue for VDI_GetHdr

diff --git a/bin/varnishd/cache/cache_director.c b/bin/varnishd/cache/cache_director.c
index e4e86511c..b78e6c863 100644
--- a/bin/varnishd/cache/cache_director.c
+++ b/bin/varnishd/cache/cache_director.c
@@ -95,11 +95,17 @@ VDI_Resolve(VRT_CTX)
 			VSLb(bo->vsl, SLT_FetchError,
 			    "Director %s returned no backend", d->vcl_name);
 	}
+
 	CHECK_OBJ_ORNULL(d, DIRECTOR_MAGIC);
-	if (d == NULL)
+	if (d == NULL) {
 		VSLb(bo->vsl, SLT_FetchError, "No backend");
-	else
+	} else {
 		AN(d->vdir);
+
+		if (d->vdir->admin_health->health == 0)
+			d = NULL;
+	}
+
 	return (d);
 }
 


More information about the varnish-commit mailing list