write failure followed by an allocation failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
Opinion
|
Undecided
|
Unassigned |
Bug Description
hi all,
I use memcached 1.4.13 and libmemcached 1.0.4 on CentOS 5.5 64bit. Once the SET operation failed because server temporarily out of memory, the following retry will get write failure error, and it can never auto recovery. My application code looks like this:
retry = 0;
do {
g_rc = memcached_
if (g_rc != MEMCACHED_SUCCESS) {
} else {
break;
}
Wait(10000); // 10000ms
} while (++retry < 3);
output:
Set_Failed: /data/_
Set_Failed: /data_lcsO_
Set_Failed: /data/_
Set_Failed: /data/PANI_
Set_Failed: /data/PANI_
error code 17:MEMCACHED_
so after a failure of allocation, the app is trapped in write failure and can never recovery.
any hint?
some more information. the client is set like this:
g_client = memcached_ create( NULL); server_ add(g_client, "127.0.0.1", port); behavior_ set(g_client, MEMCACHED_ BEHAVIOR_ DISTRIBUTION, _DISTRIBUTION_ CONSISTENT) ; behavior_ set(g_client, MEMCACHED_ BEHAVIOR_ BINARY_ PROTOCOL, 1)
g_rc = memcached_
memcached_
MEMCACHED
memcached_
it can easily reproduced by run memcached in gdb, break at one line below "item_alloc" in bin_update( ) at memcached.c:2017
process_
set the allocated item, namely it, to 0 to mimic allocation failure, and continue to run.