I have just previously updated memcached to 1.4.34 from pkg and updated it 
to 1.4.35 right after from the source because of this error. OS is FreeBSD 
10.3. I have used 'libmemcache' and it is just before the problem updated 
to version 1.0.18_4. 

In the program code, the connection is started with:
memc = memcached( &connectstr[0], (size_t) connectstrlen );

After this, the server connection is waited (arbitrarily long time), forked 
a new process and the command is sent using:
mret = memcached_set( &(*memc), &(*cptr), (size_t) ukeylen, &(*vptr), 
(size_t) memcdatalen, \
                                   (time_t) (60*timeout), mflags );

The data is set in the memcached and verified with telnet <ip> <port> and 
command stats and with a commandline tool
memexist --servers="<string>" <key> and with a custom programmed testing 
tool.

However, the memcached_set is left in the following error conditions:

The errors are:
error 3, MEMCACHED_CONNECTION_FAILURE
error 26, MEMCACHED_ERRNO               errno 54 'Connection reset by peer'

At the same time in memcached.log:
21: going from conn_new_cmd to conn_waiting
21: going from conn_waiting to conn_read
21: going from conn_read to conn_parse_cmd
<21 set <KEY> 0 14400 88
21: going from conn_parse_cmd to conn_nread
> NOT FOUND <KEY>
>21 STORED
21: going from conn_nread to conn_write
21: going from conn_write to conn_new_cmd
21: going from conn_new_cmd to conn_waiting

And clearly the KEY is stored there with the tools as well.

The connection is broken just after the call and the answer is not read. 
What is the reason? Ascii protocol is in use and the values are mostly 
ascii characters. Is using:
memcached_st* memcached_create(memcached_st *ptr)  mandatory?

Connection string is: [--POOL-MIN=5 --POOL-MAX=10 --NUMBER-OF-REPLICAS=2 
--SND-TIMEOUT=20 --SOCKET-SEND-SIZE=2048 --RCV-TIMEOUT=20 
--SOCKET-RECV-SIZE=8192 --CONNECT-TIMEOUT=30 --SORT-HOSTS 
--SERVER=<IP>:<PORT>]

What is the reason the client (last updated in 2014) is refusing the answer 
from the (new) memcached server?

Similar errors: 
http://grokbase.com/t/gg/memcached/11byt51ajp/connection-reset-by-peer
https://forums.freebsd.org/threads/58337

With best regards, Jouni

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to