Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 224 by antoun.k...@gmail.com: memcached exits with code 0, under abnormal conditions
http://code.google.com/p/memcached/issues/detail?id=224

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.

Reply via email to