Skip to content

Commit 6c47dd9

Browse files
rgw/d4n: fix for rgw user create hanging when vstart
cluster starts when there is data in cache. the cleaning thread sleeps when the entry for cleaning has not expired, therefore radosgw-admin user create hangs when vstart cluster comes up. Signed-off-by: Pritha Srivastava <[email protected]>
1 parent aa3bd25 commit 6c47dd9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rgw/driver/d4n/d4n_policy.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,11 @@ void LFUDAPolicy::cleaning(const DoutPrefixProvider* dpp)
973973
erase_dirty_object(dpp, e->key, null_yield);
974974
}
975975
} else if (diff < interval) { //end-if std::difftime(time(NULL), e->creationTime) > interval
976-
std::this_thread::sleep_for(std::chrono::seconds(interval - diff));
976+
{
977+
std::unique_lock<std::mutex> wait_lock(lfuda_cleaning_lock);
978+
cond.wait_for(wait_lock, std::chrono::seconds(interval - diff), []{ return quit.load(); });
979+
}
980+
continue;
977981
}
978982
} //end-while true
979983
}

0 commit comments

Comments
 (0)