<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:36:45 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>[CSHARP-411] NRE in timer thread</title>
                <link>https://jira.mongodb.org/browse/CSHARP-411</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;After running for a few minutes doing some DB operations, I attached the debugger and found out there are NREs happening in the background at the following stack trace:&lt;br/&gt;
	MongoDB.Driver.DLL!MongoDB.Driver.Internal.MongoConnection.Open() Line 362 + 0x5 bytes	C#&lt;br/&gt;
 	MongoDB.Driver.DLL!MongoDB.Driver.Internal.MongoConnection.GetNetworkStream() Line 522	C#&lt;br/&gt;
 	MongoDB.Driver.DLL!MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoDB.Driver.Internal.MongoRequestMessage message, MongoDB.Driver.SafeMode safeMode) Line 473 + 0xc bytes	C#&lt;br/&gt;
 	MongoDB.Driver.DLL!MongoDB.Driver.Internal.MongoConnection.RunCommand(string collectionName, MongoDB.Driver.QueryFlags queryFlags, MongoDB.Driver.CommandDocument command, bool throwOnError) Line 389 + 0x3f bytes	C#&lt;br/&gt;
 	MongoDB.Driver.DLL!MongoDB.Driver.MongoServerInstance.Ping() Line 217 + 0x2c bytes	C#&lt;br/&gt;
 	MongoDB.Driver.DLL!MongoDB.Driver.MongoServerInstance.VerifyState() Line 236 + 0xc bytes	C#&lt;br/&gt;
 	MongoDB.Driver.DLL!MongoDB.Driver.Internal.MongoConnectionPool.TimerCallback(object state) Line 344	C#&lt;br/&gt;
 	mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x178 bytes	&lt;/p&gt;


&lt;p&gt;It appears that _serverInstance.EndPoint is null for some reason. I&apos;m using git version 77ac96b73b3fe9f4517cc79d3c72c2d87e1bbc9a.&lt;/p&gt;</description>
                <environment></environment>
        <key id="32935">CSHARP-411</key>
            <summary>NRE in timer thread</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="onyxmaster">Aristarkh Zagorodnikov</reporter>
                        <labels>
                    </labels>
                <created>Wed, 14 Mar 2012 13:08:07 +0000</created>
                <updated>Thu, 2 Apr 2015 18:28:11 +0000</updated>
                            <resolved>Tue, 20 Mar 2012 04:18:16 +0000</resolved>
                                    <version>1.4</version>
                                    <fixVersion>1.4</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="100431" author="rstam" created="Tue, 20 Mar 2012 04:18:16 +0000"  >&lt;p&gt;The DNS lookups are now handled slightly differently so that this NullReferenceException no longer occurs.&lt;/p&gt;</comment>
                            <comment id="99157" author="rstam" created="Thu, 15 Mar 2012 14:25:16 +0000"  >&lt;p&gt;Thanks for the extra information. Even though the exception can be explained by a DNS failure to resolve, this is a situation that could happen to anybody and it would be better if it was handled without throwing exceptions, so I will fix that.&lt;/p&gt;

&lt;p&gt;Knowing the root cause will make it easy to reproduce.&lt;/p&gt;</comment>
                            <comment id="99144" author="onyxmaster" created="Thu, 15 Mar 2012 14:04:18 +0000"  >&lt;p&gt;Good thing you mentioned DNS, I checked and found that one of the servers mentioned in the connection string (it&apos;s a replica set) had its DNS name spelled wrong.&lt;br/&gt;
The &lt;em&gt;server&lt;/em&gt; is in the &quot;Connected&quot; state, but the &lt;em&gt;server&lt;/em&gt; &lt;em&gt;instance&lt;/em&gt; is in the &quot;Disconnected&quot; state.&lt;/p&gt;</comment>
                            <comment id="99120" author="rstam" created="Thu, 15 Mar 2012 13:31:08 +0000"  >&lt;p&gt;Getting a NullReferenceException on that line makes more sense. I&apos;ll investigate further.&lt;/p&gt;

&lt;p&gt;The endPoint is the result of a DNS lookup, which is done once when Connect is called. The timer code doesn&apos;t do the Ping if the server state is Disconnected or Disconnecting, but it looks like there is a race condition where the server might be in some other state but has not yet resolved the endPoint address.&lt;/p&gt;

&lt;p&gt;In a sense this is harmless because the exception is ignored. But annoying nonetheless.&lt;/p&gt;</comment>
                            <comment id="99038" author="onyxmaster" created="Thu, 15 Mar 2012 06:22:12 +0000"  >&lt;p&gt;My line 362 is:&lt;br/&gt;
            var tcpClient = new TcpClient(endPoint.AddressFamily);&lt;/p&gt;</comment>
                            <comment id="99000" author="rstam" created="Thu, 15 Mar 2012 02:35:03 +0000"  >&lt;p&gt;What&apos;s at your line number 362 in MongoConnection?&lt;/p&gt;

&lt;p&gt;I have:&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;tcpClient.Connect(endPoint);&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;Which couldn&apos;t throw a NullReferenceException, and there&apos;s another use of the endPoint variable 4 lines earlier which would have thrown a NullReferenceException before reaching this line.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrh7vz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14077</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>