Skip to content

Commit

Permalink
broker: flush content cache on request
Browse files Browse the repository at this point in the history
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 flux-framework#4378
  • Loading branch information
chu11 committed Jun 21, 2022
1 parent 4aafc3b commit 3ddf1cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/broker/content-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3ddf1cf

Please sign in to comment.