1.0.18
+* MEMCACHED_BEHAVIOR_RETRY_TIMEOUT can now be set to zero.
1.0.17 Tue Apr 2 14:02:01 HST 2013
* Remove c++ namespace that was being exposed (the API should be plug compatible)..
break;
case MEMCACHED_BEHAVIOR_RETRY_TIMEOUT:
- if (data == 0)
- {
- return memcached_set_error(*ptr, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_AT,
- memcached_literal_param("MEMCACHED_BEHAVIOR_RETRY_TIMEOUT requires a value greater then zero."));
- }
ptr->retry_timeout= int32_t(data);
break;
{
if (server->state != MEMCACHED_SERVER_STATE_IN_TIMEOUT)
{
- struct timeval next_time;
- if (gettimeofday(&next_time, NULL) == 0)
+ if (server->root->retry_timeout != 0)
{
- server->next_retry= next_time.tv_sec +server->root->retry_timeout;
- }
- else
- {
- server->next_retry= 1; // Setting the value to 1 causes the timeout to occur immediatly
- }
+ struct timeval next_time;
+ if (gettimeofday(&next_time, NULL) == 0)
+ {
+ server->next_retry= next_time.tv_sec +server->root->retry_timeout;
+ }
+ else
+ {
+ server->next_retry= 1; // Setting the value to 1 causes the timeout to occur immediatly
+ }
- server->state= MEMCACHED_SERVER_STATE_IN_TIMEOUT;
+ server->state= MEMCACHED_SERVER_STATE_IN_TIMEOUT;
+ }
if (server->server_failure_counter_query_id != server->root->query_id)
{
server->server_failure_counter++;
{"lp:1021819", true, (test_callback_fn*)regression_1021819_TEST },
{"lp:1048945", true, (test_callback_fn*)regression_1048945_TEST },
{"lp:1067242", true, (test_callback_fn*)regression_1067242_TEST },
+ {"lp:1251482", true, (test_callback_fn*)regression_bug_1251482 },
{0, false, (test_callback_fn*)0}
};
/* Put a retry timeout to effectively activate failure_limit effect */
test_compare(MEMCACHED_SUCCESS,
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, true));
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, 1));
/* change behavior that triggers memcached_quit()*/
test_compare(MEMCACHED_SUCCESS,
return TEST_SUCCESS;
}
+test_return_t regression_bug_1251482(memcached_st*)
+{
+ test::Memc memc("--server=localhost:0");
+
+ memcached_behavior_set(&memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, 0);
+
+ for (size_t x= 4; x; --x)
+ {
+ size_t value_length;
+ memcached_return_t rc;
+ char *value= memcached_get(&memc,
+ test_literal_param(__func__),
+ &value_length, NULL, &rc);
+
+ test_false(value);
+ test_compare(0LLU, value_length);
+ test_compare(MEMCACHED_CONNECTION_FAILURE, rc);
+ }
+
+ return TEST_SUCCESS;
+}
+
test_return_t regression_1009493_TEST(memcached_st*)
{
memcached_st* memc= memcached_create(NULL);
test_return_t regression_1048945_TEST(memcached_st*);
test_return_t regression_1067242_TEST(memcached_st*);
test_return_t comparison_operator_memcached_st_and__memcached_return_t_TEST(memcached_st*);
+test_return_t regression_bug_1251482(memcached_st*);