summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois BUSTARRET <jfbustarret@wat.tv>2007-10-03 20:03:55 +0000
committerJean-Francois BUSTARRET <jfbustarret@wat.tv>2007-10-03 20:03:55 +0000
commit505bf15af117653e2e4e790a6ebeffaeab5bc967 (patch)
treeb2aa0bbdd62a00ec38c9ba158c79710af65dc6c2
parentfc2e8effbb555e853bb71bdc0d01525a5a9dbfe3 (diff)
downloadmemcached-505bf15af117653e2e4e790a6ebeffaeab5bc967.tar.gz
Fix for stats.evictions not incrementing when exptime == 0 items
are kicked off the cache from Jean-Francois BUSTARRET <jfbustarret@wat.tv>. git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@616 b0b603af-a30f-0410-a34e-baf09ae79d0b
-rw-r--r--ChangeLog4
-rw-r--r--items.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f806a18..54e5823 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
change allows you to do atomic changes to an
existing key.
+ * Fix for stats.evictions not incrementing
+ when exptime == 0 items are kicked off the cache.
+ from Jean-Francois BUSTARRET <jfbustarret@wat.tv>.
+
2007-08-21 Paul Lindner <lindner@inuus.com>
* Incorporate incrememnt patch from Evan Miller
<emiller@imvu.com> to define increment overflow
diff --git a/items.c b/items.c
index 99ec775..c9a3607 100644
--- a/items.c
+++ b/items.c
@@ -104,7 +104,7 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags, const rel_tim
for (search = tails[id]; tries > 0 && search != NULL; tries--, search=search->prev) {
if (search->refcount == 0) {
- if (search->exptime > current_time) {
+ if (search->exptime == 0 || search->exptime > current_time) {
STATS_LOCK();
stats.evictions++;
STATS_UNLOCK();