path: root/content
diff options
authorDaniel Silverstone <>2019-06-15 21:13:09 +0100
committerDaniel Silverstone <>2019-06-15 21:13:09 +0100
commit659c9161ee037bb523891ac3e3b00748cec6289f (patch)
tree7643b35d223edbd96f70e7e18fed4a3613863b3b /content
parent09fa61eb737aa93fb2e99d383c46bcf35d5d730d (diff)
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 <>
Diffstat (limited to 'content')
1 files changed, 7 insertions, 0 deletions
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) {