[master] f0d3be8 Don't mark a stream as scheduled when Pool_Task fails

Dag Haavi Finstad daghf at varnish-software.com
Mon Oct 2 09:10:07 UTC 2017


commit f0d3be819c5c8e1a2ccf88e8c1df4100a73c70a6
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Mon Oct 2 11:03:25 2017 +0200

    Don't mark a stream as scheduled when Pool_Task fails

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index 8828593..3c50d20 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -532,8 +532,10 @@ h2_end_headers(struct worker *wrk, const struct h2_sess *h2,
 	req->task.func = h2_do_req;
 	req->task.priv = req;
 	r2->scheduled = 1;
-	if (Pool_Task(wrk->pool, &req->task, TASK_QUEUE_STR) != 0)
+	if (Pool_Task(wrk->pool, &req->task, TASK_QUEUE_STR) != 0) {
+		r2->scheduled = 0;
 		return (H2SE_REFUSED_STREAM); //rfc7540,l,3326,3329
+	}
 	return (0);
 }
 
diff --git a/bin/varnishtest/tests/t02011.vtc b/bin/varnishtest/tests/t02011.vtc
index fd698ce..9c2269e 100644
--- a/bin/varnishtest/tests/t02011.vtc
+++ b/bin/varnishtest/tests/t02011.vtc
@@ -71,6 +71,9 @@ client c1 {
 # trigger an update of the stats
 varnish v1 -cliok "param.set thread_pool_min 3"
 delay 1
+varnish v1 -vsl_catchup
 varnish v1 -expect sess_drop == 0
 varnish v1 -expect sess_dropped == 0
 varnish v1 -expect req_dropped == 1
+varnish v1 -expect MEMPOOL.req0.live == 0
+varnish v1 -expect MEMPOOL.sess0.live == 0


More information about the varnish-commit mailing list