StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

HGETALL Hash not found without error on high memory pressure and multiple threads

Open jcaspes opened this issue 6 months ago • 0 comments

Hello,

While testing the StackExchange.Redis library (specifically the HGETALL api) under high memory pressure to induce frequent OutOfMemory exceptions, I encountered cases where received hashentry[] array is null or empty. No error is returned, so the calling program assumes the key does not exist, when in fact it should throw an exception.

Tested with this program: https://github.com/jcaspes/StackExchange.Redis/tree/MemoryTester/toys/MemoryTester

In this program, each thread only performs infinite HGETALL operations on a key with its thread ID, so it should only retrieve data that it has written itself.

here is a sample output; we can see that thread 27 (Th27hT) have retrieved nothing, and no exception was thrown:

27 : Key 'MemoryTester:Th27hT' not found

jcaspes avatar Jul 21 '25 14:07 jcaspes