Skip to content

Commit 0c89dc1

Browse files
pbhandar2meta-codesync[bot]
authored andcommitted
Fix use of handle after being reset
Summary: Crashes seen in CDN inside NVM find(). It is due to the event tracker logging function where we access a handle after it was reset. Reviewed By: AlnisM Differential Revision: D88648144 fbshipit-source-id: 90e8bd419ca919c1ffd6b32a6b70d3909f2cc7c9
1 parent ae567b6 commit 0c89dc1

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

cachelib/allocator/nvmcache/NvmCache.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -703,16 +703,8 @@ typename NvmCache<C>::WriteHandle NvmCache<C>::find(HashedKey hk) {
703703
findResult = AllocatorApiResult::EXPIRED;
704704
}
705705
// Special case where we have to record metadata with handle in NvmCache.h
706-
CacheAPIWrapperForNvm<C>::recordEvent(
707-
cache_, event, hk.key(), findResult,
708-
typename C::EventRecordParams{
709-
.size = hdlShared->getSize(),
710-
.ttlSecs =
711-
hdlShared->getExpiryTime() > hdlShared->getCreationTime()
712-
? hdlShared->getExpiryTime() -
713-
hdlShared->getCreationTime()
714-
: 0,
715-
.expiryTime = hdlShared->getExpiryTime()});
706+
CacheAPIWrapperForNvm<C>::recordEvent(cache_, event, hk.key(),
707+
findResult);
716708
return hdlShared;
717709
}
718710

0 commit comments

Comments
 (0)