From 3ddf1cf3be92ca3517bd2f15e8b765f5ad300811 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Mon, 20 Jun 2022 22:29:43 -0700 Subject: [PATCH] broker: flush content cache on request Problem: The content.flush target does not actually flush the cache. It only waits for current flushes to complete. This goes against documentation and can lead to issues when a cache flush has not yet initiated. Solution: Call cache_flush() from within content_flush_request(). Fixes #4378 --- src/broker/content-cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/broker/content-cache.c b/src/broker/content-cache.c index 7107a476b7d0..f43fc93cfb0d 100644 --- a/src/broker/content-cache.c +++ b/src/broker/content-cache.c @@ -774,6 +774,8 @@ static void content_flush_request (flux_t *h, flux_msg_handler_t *mh, struct content_cache *cache = arg; if (cache->acct_dirty > 0) { + if (cache_flush (cache) < 0) + goto error; if (msgstack_push (&cache->flush_requests, msg) < 0) goto error; return;