Skip to content

Commit 66b2a5e

Browse files
rlyerlymeta-codesync[bot]
authored andcommitted
deprecated objcache: fix expiry check in deprecated persistence to use <=
Summary: - Root cause: time() has 1s resolution. With ttlShort=1s and sleep 2s, when loop crosses second boundary some odds get expiry = T+2, recovery happens exactly at T+2. Old check expiry < now treats equality as valid, so expired items are recovered -> ASSERT_FALSE fails. - New objcache2 already uses <=. Changing to <= makes expiry inclusive, so sleep 2s always expires short items even with truncation. Reviewed By: AlnisM Differential Revision: D113410019 fbshipit-source-id: 32c057d7efd758264b0a80de22562168e03cbc67
1 parent d5516aa commit 66b2a5e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cachelib/experimental/deprecated_objcache/Persistence.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class RestorerWorker : public PeriodicWorker {
227227
void setBreakOut() { breakOut_ = true; }
228228

229229
bool isExpired(uint32_t expiryTime, uint32_t nowTime) {
230-
if (expiryTime != 0 && expiryTime < nowTime) {
230+
if (expiryTime != 0 && expiryTime <= nowTime) {
231231
return true;
232232
}
233233

0 commit comments

Comments
 (0)