[master] 32d2c5caa Reduce noise in VBP_Update_Backend

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Apr 16 17:52:11 UTC 2019


commit 32d2c5caad19d2385d97fbfd68bcb2c9b7425552
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Apr 16 19:50:15 2019 +0200

    Reduce noise in VBP_Update_Backend

diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index 94757a6b3..136c7413a 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -152,6 +152,7 @@ vbp_has_poked(struct vbp_target *vt)
 void
 VBP_Update_Backend(struct vbp_target *vt)
 {
+	const struct director *dir;
 	unsigned i = 0, chg;
 	char bits[10];
 
@@ -169,7 +170,8 @@ VBP_Update_Backend(struct vbp_target *vt)
 	bits[i] = '\0';
 	assert(i < sizeof bits);
 
-	if (vt->backend->director == NULL) {
+	dir = vt->backend->director;
+	if (dir == NULL) {
 		Lck_Unlock(&vbp_mtx);
 		return;
 	}
@@ -178,8 +180,9 @@ VBP_Update_Backend(struct vbp_target *vt)
 	chg = (i != vt->backend->sick);
 	vt->backend->sick = i;
 
+	AN(dir->vcl_name);
 	VSL(SLT_Backend_health, 0, "%s %s %s %s %u %u %u %.6f %.6f %s",
-	    vt->backend->director->vcl_name, chg ? "Went" : "Still",
+	    dir->vcl_name, chg ? "Went" : "Still",
 	    i ? "sick" : "healthy", bits,
 	    vt->good, vt->threshold, vt->window,
 	    vt->last, vt->avg, vt->resp_buf);
@@ -187,7 +190,7 @@ VBP_Update_Backend(struct vbp_target *vt)
 
 	if (chg) {
 		vt->backend->changed = VTIM_real();
-		VRT_SetChanged(vt->backend->director, vt->backend->changed);
+		VRT_SetChanged(dir, vt->backend->changed);
 	}
 	Lck_Unlock(&vbp_mtx);
 }


More information about the varnish-commit mailing list