[SERVER-18977] Initscript does not stop a running mongod daemon Created: 15/Jun/15 Updated: 25/Nov/15 Resolved: 25/Jun/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Packaging |
| Affects Version/s: | 3.0.3 |
| Fix Version/s: | 3.0.5, 3.1.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | James Laska | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Completed: | |||||||||
| Steps To Reproduce: | 1. Start mongod
2. Remove the mongod pid file
3. Stop mongod
4. Observe mongod is still running
|
||||||||
| Sprint: | Build 5 06/26/16 | ||||||||
| Participants: | |||||||||
| Description |
|
I believe this problem may have been misdiagnosed. I'm seeing this issue on CentOS-6.5 with `mongodb-org-server-3.0.3-1.el6.x86_64` The problem is that `service mongod stop` reports that mongo was successfully stopped.
However, hours later `mongod` is still running:
Repeated attempts to stop mongod are unsuccessful:
The problem is that the pidfile has been removed, but mongod is still running. The current initscript uses a shell function mongo_killproc which relies on the function pidofproc to determine the pid of a running mongo. This function does not work when the pid file has been removed, but mongo is still running.
The solution (for CentOS-6.5) appears to be using pidof rather than pidofproc in mongo_killproc |
| Comments |
| Comment by Sam Kleinman (Inactive) [ 09/Jul/15 ] |
|
This will be included in the 3.0.5 release. |
| Comment by James Laska [ 06/Jul/15 ] |
|
samk Thanks! How do I know when this change will be released? |
| Comment by Sam Kleinman (Inactive) [ 25/Jun/15 ] |
|
Thanks for the catch. I've committed a fix that should only remove the file if the process is not currently active. |
| Comment by Githook User [ 25/Jun/15 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by Githook User [ 25/Jun/15 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by James Laska [ 22/Jun/15 ] |
|
> Sorry for the delay in getting back to you. I'm curious to know if you've run into this issue in a situation where you did not remove the pidfile manually? Yes, I reduced the problem to this issue with the pid file. The problem manifested by issuing the ` service mongod stop/start` requests in rapid succession. I eventually found that the service remained online after issuing a stop. After review, the problem appears to be caused by the pidfile being removed, while mongod is still running. |
| Comment by Sam Kleinman (Inactive) [ 22/Jun/15 ] |
|
Sorry for the delay in getting back to you. I'm curious to know if you've run into this issue in a situation where you did not remove the pidfile manually? Regards, |