<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:14:25 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-47519] Connection closures are not logged when server shuts down</title>
                <link>https://jira.mongodb.org/browse/SERVER-47519</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When a client connects to the server and subsequently disconnects, the mongod log includes line items showing the connection being established and closed:&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;   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;{&quot;t&quot;:{&quot;$date&quot;:&quot;2020-04-13T20:42:42.167-04:00&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;NETWORK&quot;, &quot;id&quot;:51800,  &quot;ctx&quot;:&quot;conn59&quot;,&quot;msg&quot;:&quot;client metadata&quot;,&quot;attr&quot;:{&quot;remote&quot;:&quot;127.0.0.1:54986&quot;,&quot;client&quot;:&quot;conn59&quot;,&quot;doc&quot;:{&quot;driver&quot;:{&quot;name&quot;:&quot;mongo-ruby-driver&quot;,&quot;version&quot;:&quot;2.11.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;4&quot;},&quot;os&quot;:{&quot;type&quot;:&quot;linux&quot;,&quot;name&quot;:&quot;linux-gnu&quot;,&quot;architecture&quot;:&quot;x86_64&quot;},&quot;platform&quot;:&quot;2.7.0, x86_64-linux, x86_64-pc-linux-gnu&quot;}}}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;{&quot;t&quot;:{&quot;$date&quot;:&quot;2020-04-13T20:42:54.572-04:00&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;NETWORK&quot;, &quot;id&quot;:22944,  &quot;ctx&quot;:&quot;conn59&quot;,&quot;msg&quot;:&quot;connection ended&quot;,&quot;attr&quot;:{&quot;remote&quot;:&quot;127.0.0.1:54986&quot;,&quot;connectionCount&quot;:9}}&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;When a client connects to the server and the server shuts down (I used shutdown:1 command), it appears that the server is not creating a corresponding log entry for the connections being closed.&lt;/p&gt;

&lt;p&gt;For example, in &lt;a href=&quot;https://gist.github.com/p-mongo/a6976d218e2eb1140b1bac0f95415306&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://gist.github.com/p-mongo/a6976d218e2eb1140b1bac0f95415306&lt;/a&gt; there is no log entry for closing conn136.&lt;/p&gt;

&lt;p&gt;I expected the  server to  log all connection closures, whether those are initiated by the client or the server.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1313732">SERVER-47519</key>
            <summary>Connection closures are not logged when server shuts down</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="backlog-server-servicearch">Backlog - Service Architecture</assignee>
                                    <reporter username="oleg.pudeyev@mongodb.com">Oleg Pudeyev</reporter>
                        <labels>
                    </labels>
                <created>Tue, 14 Apr 2020 00:52:07 +0000</created>
                <updated>Tue, 6 Dec 2022 02:29:53 +0000</updated>
                            <resolved>Tue, 21 Apr 2020 17:11:54 +0000</resolved>
                                    <version>4.3.6</version>
                                                    <component>Logging</component>
                    <component>Networking</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="3053815" author="oleg.pudeyev" created="Fri, 24 Apr 2020 02:53:02 +0000"  >&lt;p&gt;Thank you for the explanation.&lt;/p&gt;</comment>
                            <comment id="3053765" author="jason.carey" created="Fri, 24 Apr 2020 01:53:12 +0000"  >&lt;p&gt;The problem is that there is no single coherent view point observing the difference between set 1 and set 2.&lt;/p&gt;

&lt;p&gt;After we kill all operations, all the various client threads will, at some point, discover they&apos;ve been interrupted and begin unwinding their stacks.  These stacks are unwound by separate threads that perform no synchronizing operations on close.  So the shutting down thread, which is racing towards quickExit, has no idea how many sockets have already been closed and/or have logged.  And the threads themselves have no idea if they&apos;re going to manage to close their sockets, or if the OS will do it for them.&lt;/p&gt;

&lt;p&gt;To provide what you&apos;re asking for would involve either:&lt;/p&gt;

&lt;p&gt;1. handling all socket closures from the shutdown thread&lt;br/&gt;
2. synchronization around close, and effectively blocking threads from closing sockets after a certain point in global shutdown (to avoid double-closing / double logging)&lt;/p&gt;

&lt;p&gt;Unfortunately it&apos;s not an easy change.  It would involve either a slower shutdown path, or substantially changing how we do socket closure on shutdown.  Given competing priorities, we&apos;re not going to work on this at this time&lt;/p&gt;</comment>
                            <comment id="3051862" author="oleg.pudeyev" created="Wed, 22 Apr 2020 21:07:39 +0000"  >&lt;p&gt;What I am saying is IF mongod behaves as follows:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;shutdown signal received&lt;/li&gt;
	&lt;li&gt;some connections are explicitly closed (set 1)&lt;/li&gt;
	&lt;li&gt;remaining connections are not explicitly closed but are left for OS to clean up automatically (set 2)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;AND there is a point where the server knows all members of set 2 (assuming it already knows all members of set 1 and prints log messages for those connections)&lt;/p&gt;

&lt;p&gt;THEN the server could, for each connection in set 2, print a message like &quot;abandoning connection X&quot;. This message doesn&apos;t have to match the closure of the connection timing-wise, and these messages don&apos;t need to be produced in the order of connections being closed/cleaned up by the OS. These messages are just an indicator that the server will no longer read/write on connections, and should still be helpful as &lt;b&gt;approximate&lt;/b&gt; lifetime indicators for users trying to debug their connection issues.&lt;/p&gt;</comment>
                            <comment id="3051764" author="jason.carey" created="Wed, 22 Apr 2020 20:23:15 +0000"  >&lt;p&gt;Specifically during shutdown, depending on ordering, sometimes we&apos;re not manually closing these sockets.  The process itself is going away and the OS is closing them for us after process death.&lt;/p&gt;

&lt;p&gt;There&apos;s not an opportunity to print a log message for connections closed in that way&lt;/p&gt;</comment>
                            <comment id="3049409" author="oleg.pudeyev" created="Tue, 21 Apr 2020 17:15:30 +0000"  >&lt;p&gt;How about logging that a connection has been given up on and will not be further used?&lt;/p&gt;</comment>
                            <comment id="3049401" author="jason.carey" created="Tue, 21 Apr 2020 17:11:38 +0000"  >&lt;p&gt;This isn&apos;t possible, many of those connections aren&apos;t being close by the mongo process, but instead by the operating systems&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25132"><![CDATA[Service Arch]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 20 Apr 2020 15:39:41 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 41 weeks, 6 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>alexander.golin@mongodb.com</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-servicearch</customfieldvalue>
            <customfieldvalue>mira.carey@mongodb.com</customfieldvalue>
            <customfieldvalue>oleg.pudeyev@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxf2k7:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Connect to mongod from the client&lt;/li&gt;
	&lt;li&gt;Shut down mongod&lt;/li&gt;
	&lt;li&gt;Review mongod log for the connection&lt;/li&gt;
&lt;/ul&gt;
</customfieldvalue>

                        </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|hxeotj:</customfieldvalue>

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