Skip to content

Commit 05897d6

Browse files
Evan Liangfacebook-github-bot
authored andcommitted
improve MapIndexMaxedOut error logging
Summary: The current exception string for MapIndexMaxedOut is not very useful because ```oldHashTable.viewWriteHandle()->getKey()``` can have null terminators in it and cause the c_str() to be terminated incorrectly. Regardless, the actual write handle key is not very useful to us. Log the aid explicitly. Example log: ``` Sep 14 07:12:57 tsp_lla/tao/prod-opt-follower/1879 dpdaemon[442]: E0914 07:12:57.836133 1922 Refill.cpp:215] Index has maxed out for key: #1<A4><D1 (https://github.com/facebook/CacheLib/commit/3ec18f5591f75fa5e247cadad19a86126075bdda)>0F<F6>\ ``` Reviewed By: vrishal Differential Revision: D39518530 fbshipit-source-id: 58b9f31f6c0d174d5ec0bc7705788408bc0d11f4
1 parent 46a34ad commit 05897d6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cachelib/datatype/Map-inl.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,9 @@ auto copyHashTable(
208208
if (newSize > kMaxHashTableSize) {
209209
// This shouldn't happen. Too many entries for a single object in memory.
210210
auto exStr = folly::sformat(
211-
"Index has maxed out for key: {}. Existing entries: {}, New requested "
212-
"capacity: {}. New requested size: {}",
213-
oldHashTable.viewWriteHandle()->getKey(), oldHashTable->numEntries(),
214-
newCapacity, newSize);
211+
"Index has maxed out for the provided key. Existing entries: {}, New "
212+
"requested capacity: {}. New requested size: {}",
213+
oldHashTable->numEntries(), newCapacity, newSize);
215214
throw cachelib::MapIndexMaxedOut(exStr.c_str());
216215
}
217216

0 commit comments

Comments
 (0)