From 659c9161ee037bb523891ac3e3b00748cec6289f Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 15 Jun 2019 21:13:09 +0100 Subject: llcache: Abort cleanly if called back during shutdown In order to help us debug shutting down with active fetches, this will abort the process cleanly if we get a callback to an "active" llcache handle after the abort process has actually killed them all. This can happen with deferred fetcher aborts in the cURL fetcher. Signed-off-by: Daniel Silverstone --- content/llcache.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'content/llcache.c') diff --git a/content/llcache.c b/content/llcache.c index 58ac00a7c..625e810ff 100644 --- a/content/llcache.c +++ b/content/llcache.c @@ -2762,6 +2762,13 @@ static void llcache_fetch_callback(const fetch_msg *msg, void *p) llcache_object *object = p; llcache_event event; + if (llcache == NULL) { + NSLOG(llcache, CRITICAL, "Callback happened after llcache finalisation"); + assert(false); + /* In case assertions are off, return here */ + return; + } + NSLOG(llcache, DEBUG, "Fetch event %d for %p", msg->type, object); switch (msg->type) { -- cgit v1.2.3