init.d restart operation can fail without proper notice if the memcached process takes a long time (> 1s) to shut down
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
memcached (Debian) |
Fix Released
|
Unknown
|
|||
memcached (Ubuntu) |
Fix Released
|
Medium
|
Clint Byrum | ||
Lucid |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
TEST CASE:
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.
i=0
while i < int(sys.argv[1]):
mc.
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.
----
Binary package hint: memcached
I have noticed that sometimes on a production memcached service the restart command is not always reliable. If the memcached process has allocated a lot of memory, it sometimes take a little while to shut down.
The init.d script seems to approach this by inserting a "sleep 1" between the stop and start operations, but that's not always enough.
When the memcached service is started again it will fail to start with the error "failed to listen on TCP port XXXXX: Address already in use" since the dying process still owns the port.
Release: Ubuntu 10.10
memcached:
Installed: 1.4.5-1ubuntu1
Candidate: 1.4.5-1ubuntu1
Version table:
*** 1.4.5-1ubuntu1 0
500 http://
100 /var/lib/
Related branches
Changed in memcached (Ubuntu): | |
status: | Confirmed → In Progress |
assignee: | nobody → Clint Byrum (clint-fewbar) |
description: | updated |
Changed in memcached (Ubuntu Lucid): | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in memcached (Debian): | |
status: | Unknown → New |
Changed in memcached (Debian): | |
status: | New → Fix Committed |
Changed in memcached (Debian): | |
status: | Fix Committed → Fix Released |
I've seen this as well trent and never gotten around to reporting it. Marking Confirmed, setting importance to Medium.