Commit ef930917 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Do not try to expire objects that are still busy.

There is a short window of opportunity between HSH_Insert() and
HSH_Unbusy(), where the locks are released and the expiry thread can
try to expire an object that is still busy (for objects with very
short TTL). This patch makes the expiry thread check for busy objects
and wait if the head of the binheap is busy.

No test case as the window is too small.

Fixes: #1150
parent d1ba9327
......@@ -371,6 +371,13 @@ exp_timer(struct sess *sp, void *priv)
continue;
}
/* If the object is busy, we have to wait for it */
if (oc->flags & OC_F_BUSY) {
Lck_Unlock(&exp_mtx);
oc = NULL;
continue;
}
/*
* It's time...
* Technically we should drop the exp_mtx, get the lru->mtx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment