[SERVER-6014] init.d/mongod causing 5 minute delay upon restart Created: 06/Jun/12  Updated: 10/Dec/14  Resolved: 29/Jan/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.0.6
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: ttt Assignee: Ernie Hershey
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

centos 5


Attachments: File init.d-mongod.patch    
Issue Links:
Duplicate
duplicates SERVER-9253 `rpm/init.d-mongod stop` unnecessaril... Closed
Backwards Compatibility: Fully Compatible
Operating System: Linux
Participants:

 Description   

attaching the patch to a version we're using



 Comments   
Comment by Ernie Hershey [ 10/Jan/14 ]

I just saw this occur on system shutdown of bbout1 which is an Amazon Linux machine.

Comment by Ernie Hershey [ 16/Oct/13 ]

Sorry for the delay. I still intend to test this further.

Comment by Ernie Hershey [ 15/Apr/13 ]

That is super helpful, thank you!! I'm going to do some further testing and will post an update here.

Comment by ttt [ 15/Apr/13 ]

You are right, it looks like i have mistaken the killproc version and:

killproc -p "$DBPATH"/mongod.lock -t30 -TERM /usr/bin/mongod

probably should be:

killproc -p "$DBPATH"/mongod.lock /usr/bin/mongod -TERM

Nonetheless, the original patch appears to work, interpretting '-t30' for a
process name (which may have some consequences).

Quite a few months passed after I was at this issue, but I think it has to
do with the "killproc -d300".
Scenario:
1) killproc tries to kill process with -TERM;
2) killproc sleeps some, checks if process ended. Of course - when you shut
down huge and actively used database - it is still running - trying to
finish queries;
3) killproc then sleeps for the specified delay of 300 seconds, no
questions asked;
4) in meantime mongod finishes and is not restarting until that sleep (3)
ends.

also, in the patch I'm specifically avoiding to kill mongod with -9 as not
to step on to long finishing process (which is still possible) - at the
time I possibly had some databases running without durability so randomly
killing db with -9 led to guaranteed problems, with durability its less
disastrous but still may cause problems. If mongod is unable to finish by
itself (unlikely), there is a case for investigation.

On Mon, Apr 15, 2013 at 11:39 PM, Tadas / XtGem <tadas@xtgem.com> wrote:

Comment by ttt [ 15/Apr/13 ]

CentOS 5

Comment by Ernie Hershey [ 15/Apr/13 ]

Also, what OS was your patch generated from? I don't see a "-t" option to killproc in RedHat 6.3, for example.

Comment by Ernie Hershey [ 15/Apr/13 ]

Hi,

Can you provide more detail on the conditions when you see a 5 minute delay? Is it when there's no clean shutdown?

Thanks!

Generated at Thu Feb 08 03:10:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.