Browse Source

[Fix] Fix eviction corner case

Issue: #2991
tags/2.0
Vsevolod Stakhov 4 years ago
parent
commit
c36131d2bd
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      src/libutil/hash.c

+ 5
- 0
src/libutil/hash.c View File

@@ -481,6 +481,10 @@ rspamd_lru_hash_evict (rspamd_lru_hash_t *hash, time_t now)
}
}
});

if (selected) {
elt = selected;
}
}
else {
/* Fast random eviction */
@@ -493,6 +497,7 @@ rspamd_lru_hash_evict (rspamd_lru_hash_t *hash, time_t now)
}
}

/* Evict if nothing else has been cleaned */
if (elt && nexpired == 0) {
rspamd_lru_hash_remove_node (hash, elt);
}

Loading…
Cancel
Save