• antirez's avatar
    Fix active expire division by zero. · 5e7e5e6b
    antirez authored
    Likely fix #6723.
    
    This is what happens AFAIK: we enter the main loop where we expire stuff
    until a given percentage of keys is still found to be logically expired.
    There are however other potential exit conditions.
    
    However the "sampled" variable is not always incremented inside the
    loop, because we may found no valid slot as we scan the hash table, but
    just NULLs ad dict entries. So when the do/while loop condition is
    triggered at the end, we do (expired*100/sampled), dividing by zero if
    we sampled 0 keys.
    5e7e5e6b
expire.c 25 KB