[master] f378c80 If we fail to allocate storage, it can be because the request is too large to serve in one bite, so chop it down until we reach fetch_chunksize before we start LRU flushing to make space for it.

Poul-Henning Kamp phk at varnish-cache.org
Mon Mar 28 10:27:14 CEST 2011


commit f378c80aec1e2b958d8bc9d67cb9fa203b5702fb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Mar 28 08:25:53 2011 +0000

    If we fail to allocate storage, it can be because the request is
    too large to serve in one bite, so chop it down until we reach
    fetch_chunksize before we start LRU flushing to make space for it.
    
    Fixes #880

diff --git a/bin/varnishd/stevedore.c b/bin/varnishd/stevedore.c
index 1fcf75c..fbc9557 100644
--- a/bin/varnishd/stevedore.c
+++ b/bin/varnishd/stevedore.c
@@ -134,6 +134,11 @@ stv_alloc(const struct sess *sp, size_t size)
 		if (st != NULL)
 			break;
 
+		if (size > params->fetch_chunksize) {
+			size >>= 1;
+			continue;
+		}
+
 		/* no luck; try to free some space and keep trying */
 		if (EXP_NukeOne(sp, stv->lru) == -1)
 			break;



More information about the varnish-commit mailing list