allen8807 / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

scritps/memcached-init script does not restart reliably #250

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
# This is only pertinent on Debian and Ubuntu systems:
1. install memcached and python-memcache
2. edit /etc/memcached.conf and change -m 64 to -m 640
3. sudo service memcached restart
4. Run the following test script with '300000' as an argument

#!/usr/bin/python

import memcache
import sys

mc = memcache.Client(['127.0.0.1:11211'], debug=1)

i=0
while i < int(sys.argv[1]):
    mc.set("key_%09d" % i, "A" * 1024)
    i += 1

5. Run the script again, with 1000000 with & to background it
6. sudo service memcached restart
7. verify that memcached is running (pidof memcached). If it is not, then this 
bug exists.

As this is a race condition, you may have to repeat steps 4 through 7 a few 
times before you reproduce the issue. On precise, it took about 15 tries. If 
you have the older version of /etc/init.d/memcached which does 'sleep 1' in it, 
then you can make it more likely by removing the sleep 1.

What version of the product are you using? On what operating system?
This has been verified up to 1.4.13 on the dev release of precise

Please provide any additional information below.

This was originally reported in Ubuntu:

http://pad.lv/795673

Original issue reported on code.google.com by superama...@gmail.com on 9 Feb 2012 at 11:33

Attachments:

GoogleCodeExporter commented 9 years ago
I was just about to apply this, but suddenly I have the thinking that --retry 
doesn't exist on all platforms, which is why the sleep is in there.

Can anyone confirm this? Like SuSE or fedora not having it? I'm googling a bit 
and it seems to be that way.

...or if I'm being paranoid we can throw it in...

Original comment by dorma...@rydia.net on 29 Jul 2012 at 11:10

GoogleCodeExporter commented 9 years ago
closing old stuff.

Original comment by dorma...@rydia.net on 5 Jul 2015 at 3:48