Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save lkarsten/18d35c409d2227bd7d74 to your computer and use it in GitHub Desktop.

Select an option

Save lkarsten/18d35c409d2227bd7d74 to your computer and use it in GitHub Desktop.

Revisions

  1. Lasse Karstensen created this gist Jan 16, 2016.
    29 changes: 29 additions & 0 deletions 0001-Handle-missing-waiting-list-gracefully.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    From a1d9d3122e780bb7d4c384eb668398089ced5df3 Mon Sep 17 00:00:00 2001
    From: Lasse Karstensen <[email protected]>
    Date: Sat, 16 Jan 2016 15:32:16 +0100
    Subject: [PATCH] Handle missing waiting list gracefully.

    In 5c8268062bf06a2700dd27331c29c48d650c9197 the checks are relaxed,
    but this commit (or part of) was not brought into 4.1.
    ---
    bin/varnishd/cache/cache_hash.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
    index 18b9628..27a1f24 100644
    --- a/bin/varnishd/cache/cache_hash.c
    +++ b/bin/varnishd/cache/cache_hash.c
    @@ -522,8 +522,10 @@ hsh_rush(struct worker *wrk, struct objhead *oh)
    CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
    CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
    Lck_AssertHeld(&oh->mtx);
    + if (oh->waitinglist == NULL)
    + return;
    wl = oh->waitinglist;
    - CHECK_OBJ_NOTNULL(wl, WAITINGLIST_MAGIC);
    + CHECK_OBJ(wl, WAITINGLIST_MAGIC);
    for (u = 0; u < cache_param->rush_exponent; u++) {
    req = VTAILQ_FIRST(&wl->list);
    if (req == NULL)
    --
    1.9.5 (Apple Git-50.3)