Bug #25070 service mysqld-nt.exe sometimes cannot be stopped from service mgr, kill needed
Submitted: 14 Dec 2006 12:21 Modified: 24 Oct 2007 14:07
Reporter: Carsten Segieth Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.28-enterprise-nt-log OS:Windows (Windows 2003 Server)
Assigned to: Georgi Kodinov CPU Architecture:Any

[14 Dec 2006 12:21] Carsten Segieth
Description:
Sometimes (but not in all cases) the attempt to stop the service 'mysqld-nt.exe' fails and the service can only be stopped with the kill command or by killing it from the task manager.

This happens both when trying to stop the service from the service manager by clicking on the 'stop service' button and by running the 'sc stop ...' command.

Up to now I've never seen this problem on any WinXP machine.

How to repeat:
- install Merlin 1.0.0 on win2003a-x86
- let it run a while (hours ... days ...?)
- try to stop the contained 'MySQLNetworkMySQL' service
- in some cases you will see the problem

Suggested fix:
- make it stoppable in all cases from servie manager
[8 Jan 2007 15:27] Carsten Segieth
I just had the problem again ...

Attachment: bug#25070.jpg (image/jpeg, text), 46.77 KiB.

[24 Oct 2007 14:07] Georgi Kodinov
I don't think this is related to the Windows services code of MySQL. The "Stop" button from the windows service control manager just triggers a normal shutdown (similar to pressing Ctrl-C on the server console on Unixes). The server doesn't always listen for that signal : it starts listening after re-playing the transaction logs. So any service stop request is not processes during that time.
Besides the normal shutdown can take some good amount of time even after successfully receiving the event.
There is a message written right at the start of the "stop" signal processing in the application error log (the system one, from control panel).
So there's a clear indication that the signal is not lost and the server is aware that it needs to stop.
There may be some time before the server actually stops. 
I've tried reproducing the effect on the mentioned platform and haven't been able to reproduce it.
Please provide a clear procedure to reproduce the effect (I'm not saying it's a bug, as this may be perfectly normal behavior or a red herring).