[SERVER-29045] Service stop fails and returns OK Created: 03/May/17 Updated: 12/Jul/17 Resolved: 09/Jun/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | 3.2.12 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Dharshan Rangegowda | Assignee: | Mark Agarunov |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Sometimes when the mongod service is stopped it appears to work but returns a failed code (Return code is1) Stopping mongod: [FAILED] Here are the logs
|
| Comments |
| Comment by Mark Agarunov [ 09/Jun/17 ] |
|
Hello dharshanr@scalegrid.net, The output you are seeing is most likely due to the service command being a shim to systemd's systemctl command. service is returning OK even though the underlying systemctl command is returning FAILED. The failure you are seeing is likely coming from systemd / systemctl, the init system being used. Thanks, |
| Comment by Dharshan Rangegowda [ 24/May/17 ] |
|
Hi Mark, The command being issued is "service mongod stop". So this command should either fail with [FAILED] or succeed with [OK]. Currently it is failing printing both. How is this a system issue? This looks like a bug in the implementation of the above command - hence it is filed here. |
| Comment by Mark Agarunov [ 24/May/17 ] |
|
Hello dharshanr@scalegrid.net, What is the exact command being issued when you are seeing this? If you are executing systemctl restart mongodb the [FAILED] is from stopping the service and the [OK] is from starting it. Additionally, this appears to be an issue with systemd, not MongoDB itself. Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group. Thanks, |
| Comment by Dharshan Rangegowda [ 23/May/17 ] |
|
Hi Mark, If mongod failed to stop in time shouldn't the operation return a failure? In this case we are also seeing [OK]. My expectation is that if it failed to stop I would only see a [FAILED] result. |
| Comment by Mark Agarunov [ 19/May/17 ] |
|
Hello dharshanr@scalegrid.net, Looking over the output you've provided, I believe this may be due to mongod taking longer to stop than the TimeoutStopSec value of systemd. Please try adjusting this value in the systemd unit file to see if the issue persists. Thanks, |
| Comment by Dharshan Rangegowda [ 04/May/17 ] |
|
1. The OS is amazon linux |
| Comment by Mark Agarunov [ 04/May/17 ] |
|
Hello dharshanr@scalegrid.net, Thank you for the report. From the output you've provided and the behavior you describe, I suspect the issue is due to systemd timing out before MongoDB has fully stopped. To better diagnose this behavior, I'd like to clarify a couple things:
Thanks, |