From 5ce6a38bc162de8dbbdfb5d453998d0544fe0d6c Mon Sep 17 00:00:00 2001 From: dormando Date: Sun, 8 Dec 2013 18:14:15 -0800 Subject: Some tail_repair_time adjustments fix t/binary.t test. Default of 3 hours is super overkill. 1 hour is still way too much but within realm of reason. Bail if someone sets it really low (10s or negative) --- memcached.c | 4 ++++ memcached.h | 2 +- t/binary.t | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/memcached.c b/memcached.c index cc89a12..06c2efc 100644 --- a/memcached.c +++ b/memcached.c @@ -5046,6 +5046,10 @@ int main (int argc, char **argv) { return 1; } settings.tail_repair_time = atoi(subopts_value); + if (settings.tail_repair_time < 10) { + fprintf(stderr, "Cannot set tail_repair_time to less than 10 seconds\n"); + return 1; + } break; default: printf("Illegal suboption \"%s\"\n", subopts_value); diff --git a/memcached.h b/memcached.h index 9308db9..2bb9100 100644 --- a/memcached.h +++ b/memcached.h @@ -76,7 +76,7 @@ /** How long an object can reasonably be assumed to be locked before harvesting it on a low memory condition. */ -#define TAIL_REPAIR_TIME_DEFAULT (3 * 3600) +#define TAIL_REPAIR_TIME_DEFAULT (1 * 3600) /* 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) ? \ diff --git a/t/binary.t b/t/binary.t index 3eb8e0b..bc9a24f 100755 --- a/t/binary.t +++ b/t/binary.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 3549; +use Test::More tests => 3552; use FindBin qw($Bin); use lib "$Bin/lib"; use MemcachedTest; -- cgit v1.2.1