Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

disable tail_repair_time by default

We've cleaned up a lot of the refcount leaks lately, and this feature does
have a race for soemthing grabbing active data from the tail.
  • Loading branch information...
commit 59bd02ce29ca9534f75a0978d3fe8fd8456ea9a6 1 parent cb120c0
@dormando dormando authored
Showing with 4 additions and 3 deletions.
  1. +2 −1  items.c
  2. +2 −2 memcached.h
View
3  items.c
@@ -132,7 +132,8 @@ item *do_item_alloc(char *key, const size_t nkey, const int flags,
/* Old rare bug could cause a refcount leak. We haven't seen
* it in years, but we leave this code in to prevent failures
* just in case */
- if (search->time + settings.tail_repair_time < current_time) {
+ if (settings.tail_repair_time &&
+ search->time + settings.tail_repair_time < current_time) {
itemstats[id].tailrepairs++;
search->refcount = 1;
do_item_unlink_nolock(search, hv);
View
4 memcached.h
@@ -82,8 +82,8 @@
#define MAX_NUMBER_OF_SLAB_CLASSES (POWER_LARGEST + 1)
/** How long an object can reasonably be assumed to be locked before
- harvesting it on a low memory condition. */
-#define TAIL_REPAIR_TIME_DEFAULT (1 * 3600)
+ harvesting it on a low memory condition. Default: disabled. */
+#define TAIL_REPAIR_TIME_DEFAULT 0
/* warning: don't use these macros with a function, as it evals its arg twice */
#define ITEM_get_cas(i) (((i)->it_flags & ITEM_CAS) ? \
Please sign in to comment.
Something went wrong with that request. Please try again.