<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:01:19 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-2833] mongod.exe does not shut down correctly as a Windows service</title>
                <link>https://jira.mongodb.org/browse/SERVER-2833</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Rewritten description:  When a MongoDB server is stopped by the Windows Service Control Manager (with &quot;net stop mongodb&quot; or during system shutdown or restart), mongo wasn&apos;t notifying the Service Control Manager of its steps to shutdown and was ignoring a direct shutdown notification, leading to an unclean shutdown.&lt;/p&gt;

&lt;p&gt;Original description:  I&apos;ve created a service on my pc to start mongod on every start-up of the system.&lt;br/&gt;
When I try to connect to mongo from commandline by using the mongo command the result is the following error: &lt;br/&gt;
Error: couldn&apos;t connect to server 127.0.0.1 shell/mongo.js:79 exception: connect failed&lt;/p&gt;

&lt;p&gt;We figured out that the problem is that mongod didn&apos;t start properly. When I have a look at the service list the status is always &quot;starting&quot; and didn&apos;t change. The service isn&apos;t able to start up properly.&lt;/p&gt;

&lt;p&gt;When I go to the data folder where all my db data are stored and remove the mongod.lock file. The service is able to start and I can connect to mongoDB.&lt;br/&gt;
The pid which is inside the mongod.lock file isn&apos;t available when I have a look at the tast manager.&lt;/p&gt;

&lt;p&gt;When I reboot my pc the problem is going to occur again. Removing the mongod.lock file resolves the problem.&lt;/p&gt;

&lt;p&gt;Therefore I guess there is a problem that the service didn&apos;t shutdown and remove the mongod.lock file when you shutdown your pc.&lt;/p&gt;

&lt;p&gt;We were able to reproduce the problem on different computers.&lt;/p&gt;</description>
                <environment>Windows 7 64-bit</environment>
        <key id="15280">SERVER-2833</key>
            <summary>mongod.exe does not shut down correctly as a Windows service</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="weberdaniel">Daniel Weber</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Mar 2011 10:50:52 +0000</created>
                <updated>Tue, 12 Jul 2016 00:19:19 +0000</updated>
                            <resolved>Sat, 9 Jun 2012 23:54:47 +0000</resolved>
                                    <version>1.8.0</version>
                                    <fixVersion>2.0.7</fixVersion>
                    <fixVersion>2.1.0</fixVersion>
                                    <component>Usability</component>
                                        <votes>5</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="129909" author="tad" created="Sun, 10 Jun 2012 20:16:53 +0000"  >&lt;p&gt;Backported to 2.0 branch for 2.0.7.&lt;/p&gt;</comment>
                            <comment id="129907" author="auto" created="Sun, 10 Jun 2012 20:13:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;tadmarshall&apos;, u&apos;name&apos;: u&apos;Tad Marshall&apos;, u&apos;email&apos;: u&apos;tad@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2833&quot; title=&quot;mongod.exe does not shut down correctly as a Windows service&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2833&quot;&gt;&lt;del&gt;SERVER-2833&lt;/del&gt;&lt;/a&gt; &amp;#8211; shut down cleanly on OS or Service Controller shutdown event&lt;/p&gt;

&lt;p&gt;Added code to log shutdown events from the Windows Service Controller&lt;br/&gt;
and to respond correctly to those events.  Shutdown from the console&lt;br/&gt;
on logoff or shutdown callbacks (stop ignoring them).&lt;br/&gt;
Branch: v2.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e1504ed07ff7c4b0f1c96da32c36ecf607ac0229&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e1504ed07ff7c4b0f1c96da32c36ecf607ac0229&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="129472" author="schwerin" created="Sat, 9 Jun 2012 21:11:25 +0000"  >&lt;p&gt;Tad to backport for 2.0.7.&lt;/p&gt;</comment>
                            <comment id="128911" author="tad" created="Fri, 8 Jun 2012 19:44:01 +0000"  >&lt;p&gt;Changed title and description to better describe the issue, rather than the symptoms.&lt;/p&gt;</comment>
                            <comment id="70313" author="auto" created="Fri, 2 Dec 2011 01:53:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;&apos;, u&apos;name&apos;: u&apos;Tad Marshall&apos;, u&apos;email&apos;: u&apos;tad@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2833&quot; title=&quot;mongod.exe does not shut down correctly as a Windows service&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2833&quot;&gt;&lt;del&gt;SERVER-2833&lt;/del&gt;&lt;/a&gt; &amp;#8211; shut down cleanly on OS or Service Controller shutdown event&lt;/p&gt;

&lt;p&gt;Added code to log shutdown events from the Windows Service Controller&lt;br/&gt;
and to respond correctly to those events.  Shutdown from the console&lt;br/&gt;
on logoff or shutdown callbacks (stop ignoring them).&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c8e45cce25d4de4e877e8179f21d8c93166bc964&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c8e45cce25d4de4e877e8179f21d8c93166bc964&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="70312" author="tad" created="Fri, 2 Dec 2011 01:48:34 +0000"  >&lt;p&gt;After reworking the code, my best guess for what is happening is that on the customers&apos; machines where this problem is seen, there are services running that take a little while to shut down.  This introduces a race condition in which while Windows is waiting for the Service Controller to respond to the shutdown message, it starts to kill individual processes itself.  Because we were ignoring the direct shutdown signal, we just get killed and don&apos;t shutdown cleanly.  I (hopefully) fixed this by adding code to respond correctly to both the callback from the Service Controller and also to the direct message from the OS.  I also added code to log the events from the Service Controller and do the shutdown on a named thread, so it should be clear from the log whether we got the message and how we responded to it.&lt;br/&gt;
I&apos;m going to mark this bug as &quot;fixed&quot;, but if anyone still sees it when running version 2.1.0 or later, please reopen the bug and provide as much detail as you can.  Thanks!&lt;/p&gt;</comment>
                            <comment id="70190" author="tad" created="Thu, 1 Dec 2011 19:01:43 +0000"  >&lt;p&gt;Like Robert Stam, I am unable to reproduce the &quot;no clean shutdown of Windows service&quot;, but I don&apos;t like the messages that are generated when we shut down in this mode.&lt;br/&gt;
1)  We hook the Windows shutdown message, but don&apos;t respond to it. &quot;CTRL_SHUTDOWN_EVENT signal (ignored)&quot;.  We should start our shutdown at this point and not wait for the Windows Service Controller to tell us something that we (should now) already know ... we are supposed to shut down now.&lt;br/&gt;
2)  In my log file, we show that we are starting to shut down but don&apos;t show the reason.  We should log the callback we get from the Service Control Manager to make it clear how the shutdown was triggered.&lt;br/&gt;
3)  There are error messages in the shutdown stream that don&apos;t happen when we are running as a console app and get a ctrl-C.  The problem is that we are being called on a new thread, but we don&apos;t do the thread initialialization that would allow us to shut down correctly.  We need code like this:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Client::initThread( &quot;Windows Service shutdown&quot; );&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;None of this covers the fact that I can&apos;t reproduce the reported problem.  But I can fix the problems that I can reproduce and we can see if that makes the original problem go away.&lt;/p&gt;</comment>
                            <comment id="70169" author="tad" created="Thu, 1 Dec 2011 18:06:38 +0000"  >&lt;p&gt;@Mayur Ahir &amp;#8211; please create a separate Jira ticket for your issues on Ubuntu.  This Jira ticket is specific to problems with the Windows version when installed as a Windows Service.  Thank you!&lt;/p&gt;</comment>
                            <comment id="52541" author="ahirmayur" created="Tue, 6 Sep 2011 13:15:47 +0000"  >&lt;p&gt;I am using v1.8.3 with Ubuntu 11.04 and still getting same error after reboot.&lt;br/&gt;
Here is the error log,&lt;/p&gt;
&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;$ mongo&lt;br/&gt;
MongoDB shell version: 1.8.3&lt;br/&gt;
connecting to: test&lt;br/&gt;
Tue Sep  6 18:37:38 Error: couldn&apos;t connect to server 127.0.0.1 shell/mongo.js:79&lt;br/&gt;
exception: connect failed&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt; </comment>
                            <comment id="38480" author="mcatanzariti" created="Tue, 21 Jun 2011 13:48:22 +0000"  >&lt;p&gt;net start mongodb &lt;/p&gt;

&lt;p&gt;=== BEGINING OF FILE &lt;/p&gt;

&lt;p&gt;Tue Jun 21 09:48:09 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; MongoDB starting : pid=6088 port=27017 dbpath=D:\mongoDB\data 64-bit &lt;br/&gt;
Tue Jun 21 09:48:09 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; db version v1.8.2, pdfile version 4.5&lt;br/&gt;
Tue Jun 21 09:48:09 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; git version: 433bbaa14aaba6860da15bd4de8edf600f56501b&lt;br/&gt;
Tue Jun 21 09:48:09 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; build sys info: windows (6, 1, 7600, 2, &apos;&apos;) BOOST_LIB_VERSION=1_42&lt;br/&gt;
Tue Jun 21 09:48:09 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; waiting for connections on port 27017&lt;br/&gt;
Tue Jun 21 09:48:09 &lt;span class=&quot;error&quot;&gt;&amp;#91;websvr&amp;#93;&lt;/span&gt; web admin interface listening on port 28017&lt;/p&gt;

&lt;p&gt;=== END OF FILE&lt;/p&gt;</comment>
                            <comment id="38479" author="mcatanzariti" created="Tue, 21 Jun 2011 13:47:44 +0000"  >&lt;p&gt;net stop mongodb&lt;/p&gt;

&lt;p&gt;=== BEGINING OF FILE &lt;/p&gt;

&lt;p&gt;Tue Jun 21 09:47:14 shutdown: going to close listening sockets...&lt;br/&gt;
Tue Jun 21 09:47:14 closing listening socket: 292&lt;br/&gt;
Tue Jun 21 09:47:14 closing listening socket: 300&lt;br/&gt;
Tue Jun 21 09:47:14 shutdown: going to flush diaglog...&lt;br/&gt;
Tue Jun 21 09:47:14 shutdown: going to close sockets...&lt;br/&gt;
Tue Jun 21 09:47:14 shutdown: waiting for fs preallocator...&lt;br/&gt;
Tue Jun 21 09:47:14 shutdown: closing all files...&lt;br/&gt;
Tue Jun 21 09:47:14 closeAllFiles() finished&lt;br/&gt;
Tue Jun 21 09:47:14 shutdown: removing fs lock...&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;websvr&amp;#93;&lt;/span&gt; Listener: accept() returns -1 errno:10038 An operation was attempted on something that is not a socket.&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; Listener: accept() returns -1 errno:10038 An operation was attempted on something that is not a socket.&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;websvr&amp;#93;&lt;/span&gt; select() failure: ret=-1 errno:10038 An operation was attempted on something that is not a socket.&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; select() failure: ret=-1 errno:10038 An operation was attempted on something that is not a socket.&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; now exiting&lt;br/&gt;
Tue Jun 21 09:47:14 dbexit: &lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to close listening sockets...&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to flush diaglog...&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to close sockets...&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: waiting for fs preallocator...&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: closing all files...&lt;br/&gt;
Tue Jun 21 09:47:14 closeAllFiles() finished&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: removing fs lock...&lt;br/&gt;
Tue Jun 21 09:47:14 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; couldn&apos;t remove fs lock 0&lt;br/&gt;
Tue Jun 21 09:47:14 dbexit: really exiting now&lt;/p&gt;

&lt;p&gt;=== END OF FILE&lt;/p&gt;</comment>
                            <comment id="38475" author="mcatanzariti" created="Tue, 21 Jun 2011 13:29:56 +0000"  >&lt;p&gt;There&apos;s nothing noticeable at the time of the shutdown...&lt;/p&gt;</comment>
                            <comment id="38412" author="rstam" created="Mon, 20 Jun 2011 22:54:37 +0000"  >&lt;p&gt;It&apos;s a long shot, but is there anything in the Windows event viewer at the time of the shutdown?&lt;/p&gt;</comment>
                            <comment id="38411" author="rstam" created="Mon, 20 Jun 2011 22:53:56 +0000"  >&lt;p&gt;Does &quot;net stop mongodb&quot; from the command prompt work? What about &quot;net start mongodb&quot; after that?&lt;/p&gt;

&lt;p&gt;Can you post the log file for that to compare against?&lt;/p&gt;</comment>
                            <comment id="38410" author="mcatanzariti" created="Mon, 20 Jun 2011 22:42:52 +0000"  >&lt;p&gt;Hi Robert,&lt;/p&gt;

&lt;p&gt;Yes, all the machine runs Windows 7 Enterprise with MongoDB 1.8.2&lt;/p&gt;</comment>
                            <comment id="38408" author="rstam" created="Mon, 20 Jun 2011 22:39:11 +0000"  >&lt;p&gt;I realize you have already given me your log file. I was just adding my log file for comparison.&lt;/p&gt;

&lt;p&gt; I tried to follow your steps as closely as possible and still was unable to reproduce. &lt;/p&gt;

&lt;p&gt;The only thing I see that is different is that you are using Windows 7 Enterprise and I am using Windows 7 Ultimate. Also, this time I tested using MongoDB 1.8.2, but last time I was unable to reproduce I was using MongoDB 1.8.1, so I don&apos;t think anything changed between these two versions.&lt;/p&gt;

&lt;p&gt;Are all the machines you are able to reproduce this on running Windows 7 Enterprise?&lt;/p&gt;</comment>
                            <comment id="38402" author="mcatanzariti" created="Mon, 20 Jun 2011 22:15:27 +0000"  >&lt;p&gt;Hi Robert,&lt;/p&gt;

&lt;p&gt;I just installed version 1.8.2 and still reproduce the problem...&lt;/p&gt;

&lt;p&gt;=== BEGINING OF FILE &lt;/p&gt;

&lt;p&gt;Mon Jun 20 18:08:04 CTRL_SHUTDOWN_EVENT signal (ignored)&lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; MongoDB starting : pid=2060 port=27017 dbpath=D:\mongoDB\data 64-bit &lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; db version v1.8.2, pdfile version 4.5&lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; git version: 433bbaa14aaba6860da15bd4de8edf600f56501b&lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; build sys info: windows (6, 1, 7600, 2, &apos;&apos;) BOOST_LIB_VERSION=1_42&lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; exception in initAndListen std::exception: old lock file, terminating&lt;br/&gt;
Mon Jun 20 18:10:04 dbexit: &lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to close listening sockets...&lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to flush diaglog...&lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to close sockets...&lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: waiting for fs preallocator...&lt;br/&gt;
Mon Jun 20 18:10:04 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: closing all files...&lt;br/&gt;
Mon Jun 20 18:10:04 closeAllFiles() finished&lt;br/&gt;
Mon Jun 20 18:10:04 dbexit: really exiting now&lt;/p&gt;

&lt;p&gt;=== END OF FILE&lt;/p&gt;</comment>
                            <comment id="38396" author="mcatanzariti" created="Mon, 20 Jun 2011 22:02:47 +0000"  >&lt;p&gt;Robert, &lt;/p&gt;

&lt;p&gt;I already gave you my config and the mongodb log about this problem.&lt;br/&gt;
I can add that we can reproduce it on different machines.&lt;/p&gt;

&lt;p&gt;How can I help you to reproduce the problem ?&lt;/p&gt;</comment>
                            <comment id="38324" author="rstam" created="Mon, 20 Jun 2011 15:20:05 +0000"  >&lt;p&gt;I am unable to reproduce this. Just tried again with the latest 1.8.2 release. Here&apos;s the content of my log file after &lt;/p&gt;

&lt;p&gt;1. installing MongoDB as a service&lt;br/&gt;
2. starting the service&lt;br/&gt;
3. shutdown and reboot&lt;/p&gt;

&lt;p&gt;The last few lines of the log file show MongoDB starting up cleanly after the reboot.&lt;/p&gt;

&lt;p&gt;=====log file=====&lt;br/&gt;
C:\data\db2&amp;gt;type log&lt;br/&gt;
Mon Jun 20 11:00:39 dbexit:&lt;br/&gt;
Mon Jun 20 11:00:39 shutdown: going to close listening sockets...&lt;br/&gt;
Mon Jun 20 11:00:39 shutdown: going to flush diaglog...&lt;br/&gt;
Mon Jun 20 11:00:39 shutdown: going to close sockets...&lt;br/&gt;
Mon Jun 20 11:00:39 shutdown: waiting for fs preallocator...&lt;br/&gt;
Mon Jun 20 11:00:39 shutdown: closing all files...&lt;br/&gt;
Mon Jun 20 11:00:39 closeAllFiles() finished&lt;br/&gt;
Mon Jun 20 11:00:39 dbexit: really exiting now&lt;br/&gt;
Mon Jun 20 11:00:58 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; MongoDB starting : pid=2972 port=27017 dbpat&lt;br/&gt;
h=c:\data\db2 64-bit&lt;br/&gt;
Mon Jun 20 11:00:58 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; db version v1.8.2, pdfile version 4.5&lt;br/&gt;
Mon Jun 20 11:00:58 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; git version: 433bbaa14aaba6860da15bd4de8edf6&lt;br/&gt;
00f56501b&lt;br/&gt;
Mon Jun 20 11:00:58 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; build sys info: windows (6, 1, 7600, 2, &apos;&apos;)&lt;br/&gt;
BOOST_LIB_VERSION=1_42&lt;br/&gt;
Mon Jun 20 11:00:58 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; waiting for connections on port 27017&lt;br/&gt;
Mon Jun 20 11:00:58 &lt;span class=&quot;error&quot;&gt;&amp;#91;websvr&amp;#93;&lt;/span&gt; web admin interface listening on port 28017&lt;br/&gt;
Mon Jun 20 11:08:09 CTRL_SHUTDOWN_EVENT signal (ignored)&lt;br/&gt;
Mon Jun 20 11:08:10 shutdown: going to close listening sockets...&lt;br/&gt;
Mon Jun 20 11:08:10 closing listening socket: 268&lt;br/&gt;
Mon Jun 20 11:08:10 closing listening socket: 276&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; Listener: accept() returns -1 errno:10038 An&lt;br/&gt;
 operation was attempted on something that is not a socket.&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; select() failure: ret=-1 errno:10038 An oper&lt;br/&gt;
ation was attempted on something that is not a socket.&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; now exiting&lt;br/&gt;
Mon Jun 20 11:08:10 dbexit:&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to close listening sockets..&lt;br/&gt;
.&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to flush diaglog...&lt;br/&gt;
Mon Jun 20 11:08:10 shutdown: going to flush diaglog...&lt;br/&gt;
Mon Jun 20 11:08:10 shutdown: going to close sockets...&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to close sockets...&lt;br/&gt;
Mon Jun 20 11:08:10 shutdown: waiting for fs preallocator...&lt;br/&gt;
Mon Jun 20 11:08:10 shutdown: closing all files...&lt;br/&gt;
Mon Jun 20 11:08:10 closeAllFiles() finished&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: waiting for fs preallocator...&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: closing all files...&lt;br/&gt;
Mon Jun 20 11:08:10 closeAllFiles() finished&lt;br/&gt;
Mon Jun 20 11:08:10 shutdown: removing fs lock...&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: removing fs lock...&lt;br/&gt;
Mon Jun 20 11:08:10 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; couldn&apos;t remove fs lock 0&lt;br/&gt;
Mon Jun 20 11:08:10 dbexit: really exiting now&lt;br/&gt;
Mon Jun 20 11:13:42 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; MongoDB starting : pid=1624 port=27017 dbpat&lt;br/&gt;
h=c:\data\db2 64-bit&lt;br/&gt;
Mon Jun 20 11:13:42 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; db version v1.8.2, pdfile version 4.5&lt;br/&gt;
Mon Jun 20 11:13:42 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; git version: 433bbaa14aaba6860da15bd4de8edf6&lt;br/&gt;
00f56501b&lt;br/&gt;
Mon Jun 20 11:13:42 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; build sys info: windows (6, 1, 7600, 2, &apos;&apos;)&lt;br/&gt;
BOOST_LIB_VERSION=1_42&lt;br/&gt;
Mon Jun 20 11:13:42 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; waiting for connections on port 27017&lt;br/&gt;
Mon Jun 20 11:13:42 &lt;span class=&quot;error&quot;&gt;&amp;#91;websvr&amp;#93;&lt;/span&gt; web admin interface listening on port 28017&lt;/p&gt;

&lt;p&gt;C:\data\db2&amp;gt;&lt;br/&gt;
=====end of log file=====&lt;/p&gt;</comment>
                            <comment id="38321" author="mcatanzariti" created="Mon, 20 Jun 2011 14:48:53 +0000"  >&lt;p&gt;Hi Robert,&lt;/p&gt;

&lt;p&gt;Is there any progress about this bug ?&lt;/p&gt;</comment>
                            <comment id="31941" author="rstam" created="Tue, 10 May 2011 18:48:59 +0000"  >&lt;p&gt;Thanks for the log. &lt;/p&gt;

&lt;p&gt;That&apos;s definitely different than my log. After CTRL_SHUTDOWN_EVENT I have another 20 or lines culminating with a clean exit. We&apos;ll have to figure out what&apos;s different about your environment than mine. One difference is that I&apos;m using Windows 7 Ultimate instead of Windows 7 Enterprise, but that shouldn&apos;t make any difference.&lt;/p&gt;</comment>
                            <comment id="31682" author="mcatanzariti" created="Mon, 9 May 2011 20:00:48 +0000"  >&lt;p&gt;I just installed a fresh version of mongo with no data, started it and shutowned windows 7. So there is no load &amp;amp; no data at all.&lt;/p&gt;

&lt;p&gt;This is my hardware config :&lt;br/&gt;
Intel Xeon  W3530 2.8GHz (8 cores)&lt;br/&gt;
12.0 GB&lt;/p&gt;

&lt;p&gt;This is the &quot;Path to executable&quot; windows service setting : &quot;C:\Program Files\MongoDB\bin\mongod&quot; --dbpath  &quot;D:\mongoDB\data&quot;  --logpath  &quot;D:\mongoDB\logs\log.txt&quot;  --logappend  --service  &lt;/p&gt;

&lt;p&gt;This is the content of my log.txt file&lt;/p&gt;

&lt;p&gt;=== BEGINING OF FILE&lt;br/&gt;
Mon May 09 15:27:02 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; MongoDB starting : pid=4196 port=27017 dbpath=D:\mongoDB\data 64-bit &lt;br/&gt;
Mon May 09 15:27:02 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; db version v1.8.1, pdfile version 4.5&lt;br/&gt;
Mon May 09 15:27:02 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; git version: a429cd4f535b2499cc4130b06ff7c26f41c00f04&lt;br/&gt;
Mon May 09 15:27:02 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; build sys info: windows (6, 1, 7600, 2, &apos;&apos;) BOOST_LIB_VERSION=1_42&lt;br/&gt;
Mon May 09 15:27:02 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; waiting for connections on port 27017&lt;br/&gt;
Mon May 09 15:27:02 &lt;span class=&quot;error&quot;&gt;&amp;#91;websvr&amp;#93;&lt;/span&gt; web admin interface listening on port 28017&lt;br/&gt;
Mon May 09 15:27:25 CTRL_SHUTDOWN_EVENT signal (ignored)&lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; MongoDB starting : pid=1824 port=27017 dbpath=D:\mongoDB\data 64-bit &lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; db version v1.8.1, pdfile version 4.5&lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; git version: a429cd4f535b2499cc4130b06ff7c26f41c00f04&lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; build sys info: windows (6, 1, 7600, 2, &apos;&apos;) BOOST_LIB_VERSION=1_42&lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; exception in initAndListen std::exception: old lock file, terminating&lt;br/&gt;
Mon May 09 15:29:56 dbexit: &lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to close listening sockets...&lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to flush diaglog...&lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: going to close sockets...&lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: waiting for fs preallocator...&lt;br/&gt;
Mon May 09 15:29:56 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; shutdown: closing all files...&lt;br/&gt;
Mon May 09 15:29:56 closeAllFiles() finished&lt;br/&gt;
Mon May 09 15:29:56 dbexit: really exiting now&lt;br/&gt;
=== END OF FILE&lt;/p&gt;</comment>
                            <comment id="31657" author="rstam" created="Mon, 9 May 2011 18:56:00 +0000"  >&lt;p&gt;Reopening because user reports they can reliably reproduce the issue. Am waiting for log files.&lt;/p&gt;</comment>
                            <comment id="31656" author="rstam" created="Mon, 9 May 2011 18:54:44 +0000"  >&lt;p&gt;Something must be different on our systems then. Do you have any log files we could look at? One problem with the infinite restarts when booting is that it creates very large log files, so the first step I would recommend is manually configuring the MongoDB service to only restart on failure the first or second time. And then perhaps start with a new empty log file and reproduce.&lt;/p&gt;

&lt;p&gt;Windows only allows a process about 30 seconds to shutdown, so it&apos;s possible that something is preventing mongod from shutting down within 30 seconds and is then being killed by Windows for taking too long. Is your mongod under heavy load when you reboot the system? Are there any long running operations that take more than 30 seconds?&lt;/p&gt;</comment>
                            <comment id="31654" author="mcatanzariti" created="Mon, 9 May 2011 18:43:26 +0000"  >&lt;p&gt;Sorry, but on several workstations of my company, we use mongodb 1.8.1 on Windows 7 Enterprise 64 bit.&lt;br/&gt;
And after each reboot of the machine, MongoDB is not shutting down cleanly and leave behind a mongod.lock file.&lt;br/&gt;
After the mongod.lock file deletion, the service starts with no problem.&lt;br/&gt;
The problem is reproduced systematically &lt;/p&gt;</comment>
                            <comment id="31606" author="rstam" created="Mon, 9 May 2011 15:11:58 +0000"  >&lt;p&gt;Works as designed. See previous comment.&lt;/p&gt;</comment>
                            <comment id="31605" author="rstam" created="Mon, 9 May 2011 15:11:32 +0000"  >&lt;p&gt;I just retested this using MongoDB 1.8.1 on a Windows 7 64-bit system, and it worked as designed.&lt;/p&gt;

&lt;p&gt;Just to clarify, this JIRA ticket had to do with MongoDB not shutting down cleanly when Windows was shutdown. The result of a Windows shutdown prior to this fix was that a mongod.lock file was left behind. The presence of a mongod.lock file is evidence that mongod did not shut down cleanly and that a repair should be attempted before restarting mongod.&lt;/p&gt;

&lt;p&gt;I mongod crashes for any other reason it will also leave a mongod.lock file behind, but that is unrelated to this JIRA ticket.&lt;/p&gt;

&lt;p&gt;Deleting a mongod.lock file without running repair is tempting fate a bit.&lt;/p&gt;

&lt;p&gt;I have created a new JIRA ticket regarding Windows service startup options related to mongod failing to start and how many attempts Windows will automatically make to restart the service (as opposed to this JIRA ticket which is related to a clean shutdown). See:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3063&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-3063&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="31582" author="fdhenard" created="Mon, 9 May 2011 13:34:35 +0000"  >&lt;p&gt;Likewise, as you see in my comment above.  I am using 1.8.1 with Ubuntu Server 11.04, and mongo is not stopping at shutdown.&lt;/p&gt;</comment>
                            <comment id="31580" author="mcatanzariti" created="Mon, 9 May 2011 13:27:09 +0000"  >&lt;p&gt;The fix does not seem to work on Windows 7, with the 1.8.1 release.&lt;br/&gt;
A mongod.lock still exists on my disk after reboot and prevents the windows service to start.&lt;br/&gt;
Again, removing the mongod.lock file resolves the problem. &lt;/p&gt;</comment>
                            <comment id="31247" author="rstam" created="Thu, 5 May 2011 17:26:21 +0000"  >&lt;p&gt;The fix for this didn&apos;t make in to the 1.8.0 release. It is in the 1.8.1 release.&lt;/p&gt;</comment>
                            <comment id="31246" author="rstam" created="Thu, 5 May 2011 17:25:58 +0000"  >&lt;p&gt;Fixed in 1.8.1 (not 1.8.0).&lt;/p&gt;</comment>
                            <comment id="31239" author="fdhenard" created="Thu, 5 May 2011 17:02:01 +0000"  >&lt;p&gt;I&apos;m also having this problem - Ubuntu Server 11.04, Mongo 1.8.1&lt;/p&gt;

&lt;p&gt;EDIT 6/20/11 - It turns out that I was not shutting down the server correctly.  Improperly shutting down the server did not impact apache, but was a problem for mongo because it would not start on the server restart.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="40722">SERVER-6040</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="12472">SERVER-1434</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="15053">SERVER-2719</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>32.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 5 May 2011 17:02:01 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 36 weeks, 3 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 36 weeks, 3 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[Windows]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>weberdaniel</customfieldvalue>
            <customfieldvalue>fdhenard</customfieldvalue>
            <customfieldvalue>ahirmayur</customfieldvalue>
            <customfieldvalue>mcatanzariti</customfieldvalue>
            <customfieldvalue>robert@mongodb.com</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp2nz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrgflj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9436</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hs91u7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>