allen8807 / memcached

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

memcached exits with code 0, under abnormal conditions #224

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Arrange for event_base_loop to exit with a failure code.  In libevent's 
event_base_loop, here's the fragment I suspect was exiting the loop abnormally, 
but registering as "exit code 0" with memcached.

        res = evsel->dispatch(base, evbase, tv_p);

        if (res == -1)
            return (-1);

I monitor the process with a nanny, and so when the log shows a large number of 
0-exit codes under a visibly abnormal situation, I was confused, and dug into 
the code and found out how.

What is the expected output? What do you see instead?
non-zero exit form memcached.

What version of the product are you using? On what operating system?
1.4.5 Redhat RHEL 5

Please provide any additional information below.
This is because line 4681 in memcached.c does not check event_base_loop's exit 
code.  So, when the event loop exits, the code falls through and reaches a 
"return EXIT_SUCCESS" at the end of main() a few lines later.

Original issue reported on code.google.com by antoun.k...@gmail.com on 30 Sep 2011 at 12:28

GoogleCodeExporter commented 9 years ago
About as interesting as the error code being wrong, why is your instance 
exiting from the event loop abnormally and stopping?

Original comment by dorma...@rydia.net on 30 Sep 2011 at 12:48

GoogleCodeExporter commented 9 years ago
The conditions are: a huge number of connections, exceeding the configured max. 
 This stress is sustained.

I suspect it's a epoll_wait failure that was deemed irrecoverable.

Original comment by anto...@gmail.com on 30 Sep 2011 at 7:33

GoogleCodeExporter commented 9 years ago
Fixed for the next release, thanks for the report!

for what it's worth; the crash bug you're seeing is fixed in newer releases. 
Please upgrade to 1.4.9 or newer once it's out later today.

Original comment by dorma...@rydia.net on 17 Oct 2011 at 9:26