<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:03:44 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-3684] In Cygwin, pressing ^C can terminate a mongod running in the background</title>
                <link>https://jira.mongodb.org/browse/SERVER-3684</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I was using the digg data set from the training course.  I was following along with the training course, and got to the sample that says you can query by type.&lt;/p&gt;

&lt;p&gt;Here&apos;s the console output:&lt;br/&gt;
./mongo&lt;br/&gt;
MongoDB shell version: 2.0.0-rc0-pre-&lt;br/&gt;
connecting to: test&lt;br/&gt;
&amp;gt; use digg&lt;br/&gt;
switched to db digg&lt;br/&gt;
&amp;gt; db.stories.find({&quot;href&quot;:{$type});&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;Wed Aug 24 15:33:25 Socket say send() errno:0 The operation completed successful&lt;br/&gt;
ly. 127.0.0.1:27017&lt;br/&gt;
&amp;gt; db.stories.find({&quot;href&quot;:{$type:2}});&lt;br/&gt;
Wed Aug 24 15:33:51 trying reconnect to 127.0.0.1&lt;br/&gt;
Wed Aug 24 15:33:52 reconnect 127.0.0.1 failed couldn&apos;t connect to server 127.0.&lt;br/&gt;
0.1&lt;br/&gt;
Error: error doing query: unknown&lt;br/&gt;
&amp;gt;&lt;/p&gt;

&lt;p&gt;After I made the typo, note the missing 2nd closing brace after $type.  I got the &quot;...&quot; from the shell.  Then I hit ^C.  Nothing happened, so I hit return.  Then I got the following &quot;operation successful.&quot;  Then I tried the query again, without the typo, but the server was gone.&lt;/p&gt;

&lt;p&gt;I repeated this to make sure, and the same thing happened again.&lt;/p&gt;</description>
                <environment>using mongo shell from cygwin on windows</environment>
        <key id="21496">SERVER-3684</key>
            <summary>In Cygwin, pressing ^C can terminate a mongod running in the background</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="3">Duplicate</resolution>
                                        <assignee username="tad">Tad Marshall</assignee>
                                    <reporter username="cwestin">Chris Westin</reporter>
                        <labels>
                    </labels>
                <created>Wed, 24 Aug 2011 22:38:46 +0000</created>
                <updated>Wed, 15 Aug 2012 14:04:12 +0000</updated>
                            <resolved>Sun, 3 Jun 2012 12:19:29 +0000</resolved>
                                    <version>1.9.2</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="125478" author="tad" created="Sun, 3 Jun 2012 12:17:53 +0000"  >&lt;p&gt;Another case of not working very well in Cygwin.&lt;/p&gt;</comment>
                            <comment id="71054" author="cwestin" created="Tue, 6 Dec 2011 03:30:04 +0000"  >&lt;p&gt;I run mongod in the background by using an ampersand &amp;#8211; standard unix shell thing:&lt;br/&gt;
$ ./mongod --config ../sandbox/mongodb.conf &amp;amp;&lt;/p&gt;

&lt;p&gt;Then I start the shell:&lt;br/&gt;
$ ./mongo&lt;br/&gt;
&amp;gt;&lt;/p&gt;</comment>
                            <comment id="71041" author="tad" created="Tue, 6 Dec 2011 01:46:49 +0000"  >&lt;p&gt;So, you are running both mongod.exe and mongo.exe in Cygwin windows (separate, I assume, I don&apos;t know how else to do it) and somehow a ^C in one window hits both processes?  We need to know what version and bitness of Windows you are running and the versions of the relevant Cygwin components.  I saw something on the web when I was Googling for information about Cygwin and consoles that they have changed the behavior since Windows 7 came out, maybe more than once.  Something about creating a hidden console, or something like that.  If they are sharing a single console among multiple Cygwin shell windows, that might be the thing that makes this possible.  So, probably version of Windows, bash and cygwin1.dll, maybe other bits if you can see what is loaded in the processes (using Sysinternals&apos; Process Explorer, for example).  Thanks for retesting!&lt;/p&gt;

&lt;p&gt;Oh wait, I reread what you wrote ... so you&apos;re forking mongod and then running mongo in the same shell?  Can you lay out full steps-to-reproduce so I can dupe it?&lt;/p&gt;</comment>
                            <comment id="71038" author="cwestin" created="Tue, 6 Dec 2011 01:23:42 +0000"  >&lt;p&gt;OK, I think I understand this now.  It&apos;s definitely a cygwin bug, and we can just document it.&lt;/p&gt;

&lt;p&gt;I reproduced the problem again by typing in exactly what I had above.  Here it is again:&lt;br/&gt;
$ ./mongo&lt;br/&gt;
MongoDB shell version: 2.1.0-pre-&lt;br/&gt;
connecting to: test&lt;br/&gt;
&amp;gt; use digg&lt;br/&gt;
switched to db digg&lt;br/&gt;
&amp;gt; db.stories.find({&quot;href&quot;:{$type});&lt;br/&gt;
... &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;+  Exit 12                 ./mongod --config ../sandbox/mongodb.conf&lt;/p&gt;

&lt;p&gt;cwestin@tellus ~/mongo&lt;br/&gt;
$&lt;/p&gt;

&lt;p&gt;After the &quot;...&quot;, I hit ^C to quit the shell.  Then, as you can see, mongod exited.  When I first submitted this, I hadn&apos;t bothered to check the log, assuming it crashed.  As per Eliot&apos;s request above, I checked it this time, and found this:&lt;/p&gt;

&lt;p&gt;Mon Dec 05 17:13:38 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; connection accepted from 127.0.0.1:5910 #4 (1 connection now open)&lt;br/&gt;
Mon Dec 05 17:14:11 Ctrl-C signal&lt;br/&gt;
Mon Dec 05 17:14:11 got kill or ctrl-c signal, will terminate after current cmd ends&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; now exiting&lt;br/&gt;
Mon Dec 05 17:14:11 dbexit: &lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; shutdown: going to close listening sockets...&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; closing listening socket: 480&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; closing listening socket: 488&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; shutdown: going to flush diaglog...&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; shutdown: going to close sockets...&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; shutdown: waiting for fs preallocator...&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; shutdown: lock for final commit...&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; shutdown: final commit...&lt;br/&gt;
Mon Dec 05 17:14:11 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; shutdown: closing all files...&lt;br/&gt;
		7/23	30%&lt;br/&gt;
Mon Dec 05 17:14:13 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; closeAllFiles() finished&lt;br/&gt;
Mon Dec 05 17:14:13 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; journalCleanup...&lt;br/&gt;
Mon Dec 05 17:14:13 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; removeJournalFiles&lt;br/&gt;
Mon Dec 05 17:14:13 &lt;span class=&quot;error&quot;&gt;&amp;#91;ctrlCTerminate&amp;#93;&lt;/span&gt; shutdown: removing fs lock...&lt;br/&gt;
Mon Dec 05 17:14:13 dbexit: really exiting now&lt;/p&gt;

&lt;p&gt;This is the normal shutdown sequence.  So it didn&apos;t crash.  It &lt;b&gt;also&lt;/b&gt; got the ^C.  I&apos;d forgotten that I&apos;ve seen this before.  When I teach the dba training class, one of the exercises is to set up a replica set.  The first time I did this, in order to demo failover, I tried to kill one of the mongod processes by bringing it to the foreground (with bg %) and then using ^C to kill it.  When I did this, &lt;b&gt;all&lt;/b&gt; of my mongod processes exited.  As far as I can tell, the cygwin bash shell delivers the ^C signal to all of its children.  So that&apos;s what must have happened here.  (Now when I do the demo in training, I have to run one mongod per cygwin shell).&lt;/p&gt;

&lt;p&gt;So our stuff seems to work, but Cygwin seems to have this misbehavior (i.e., delivering SIGINT to all children).  I would just document that, as well as recommending against running under Cygwin for production (although it is certainly convenient for development and demos, and given that, I would prefer if we didn&apos;t just fail it outright as suggested above).&lt;/p&gt;</comment>
                            <comment id="70112" author="tad" created="Thu, 1 Dec 2011 16:44:54 +0000"  >&lt;p&gt;I think the key item in this bug report is the &quot;environment&quot; &amp;#8211; using mongo shell from cygwin on windows .&lt;/p&gt;

&lt;p&gt;We don&apos;t work correctly under cygwin.  Our Windows code uses the Windows &quot;console&quot; features, and cygwin does not provide a console.  If working correctly under cygwin is something that we want to do, then we will need to write new code to handle this.  The new code would be a hybrid of the Linux and Windows code.  We could easily detect that we are running under cygwin &amp;#8211; it sets the environment variable TERM to &quot;cygwin&quot;.  I&apos;m not sure that this is worth doing, but if we want to do it we could.  Another option would be to refuse to run in this mode (TERM=cygwin) or just display an error message and then limp along.&lt;/p&gt;</comment>
                            <comment id="51168" author="eliot" created="Mon, 29 Aug 2011 14:47:46 +0000"  >&lt;p&gt;Can&apos;t reproduce - can you send server log?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="25954">SERVER-4423</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>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 29 Aug 2011 14:47:46 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 37 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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 37 weeks, 3 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>cwestin</customfieldvalue>
            <customfieldvalue>eliot</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|hrospb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23325</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|ht0abr:</customfieldvalue>

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