<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:45:15 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-3429] just declaring a `new MongoClient(connStr)` prevents my program from closing</title>
                <link>https://jira.mongodb.org/browse/CSHARP-3429</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description></description>
                <environment>Windows 10 1909, VS 16.8.5, RoslynPad 15.1,  dotnet core 3.1, .net 5&lt;br/&gt;
Dell Latitude 7400.  I cant type in a description, see attachment.</environment>
        <key id="1624988">CSHARP-3429</key>
            <summary>just declaring a `new MongoClient(connStr)` prevents my program from closing</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="13201">Fixed</resolution>
                                        <assignee username="boris.dogadov@mongodb.com">Boris Dogadov</assignee>
                                    <reporter username="astanton1978@gmail.com">Andrew Stanton</reporter>
                        <labels>
                    </labels>
                <created>Tue, 16 Feb 2021 21:37:15 +0000</created>
                <updated>Sat, 28 Oct 2023 11:47:57 +0000</updated>
                            <resolved>Fri, 26 Feb 2021 22:54:45 +0000</resolved>
                                    <version>2.9.0</version>
                    <version>2.11.6</version>
                                    <fixVersion>2.12.0</fixVersion>
                                    <component>Internal</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3638116" author="xgen-internal-githook" created="Fri, 26 Feb 2021 22:49:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Boris&apos;, &apos;email&apos;: &apos;boris.dogadov@mongodb.com&apos;, &apos;username&apos;: &apos;BorisDog&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-3429&quot; title=&quot;just declaring a `new MongoClient(connStr)` prevents my program from closing&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-3429&quot;&gt;&lt;del&gt;CSHARP-3429&lt;/del&gt;&lt;/a&gt;: Setting DNS thread as background&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/a0728a66bcbce20656d99179a61aee055ad12991&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/a0728a66bcbce20656d99179a61aee055ad12991&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3635937" author="JIRAUSER1257742" created="Thu, 25 Feb 2021 20:35:25 +0000"  >&lt;p&gt;Hi Andrew,&lt;br/&gt;
Thank you for reporting this issue.&lt;br/&gt;
We have successfully reproduced this behavior, and will be submitting a fix soon.&lt;/p&gt;</comment>
                            <comment id="3632627" author="JIRAUSER1258703" created="Wed, 24 Feb 2021 15:04:02 +0000"  >&lt;p&gt;Geez it is frustrating to not be able to add a comment. I could do it on at&lt;br/&gt;
 least one JIRA ticket but not this one. I&apos;m uploading the zip of the dump&lt;br/&gt;
 file I collected originally that matches the screenshot in the other report&lt;br/&gt;
 (&lt;br/&gt;
 &lt;a href=&quot;https://developer.mongodb.com/community/forums/t/simple-c-console-program-wont-close-after-var-mc-new-mongoclient-connstr/15934/3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://developer.mongodb.com/community/forums/t/simple-c-console-program-wont-close-after-var-mc-new-mongoclient-connstr/15934/3&lt;/a&gt;).&lt;br/&gt;
 I dont see where I can send the password to you without exposing it, but&lt;br/&gt;
 its &amp;lt;redacted&amp;gt;&lt;br/&gt;
 . (if you can edit that out once you unzip that would be great, if not&lt;br/&gt;
 there is nothing in there worth anyone&apos;s time to reverse engineer).&lt;/p&gt;

&lt;p&gt;If you check the latest on that, another user found that this was a problem&lt;br/&gt;
 for them with sharded clusters. Replicaset did not hang the calling program&lt;br/&gt;
 open.&lt;/p&gt;

&lt;p&gt;Your RoslynPad program does not compile as is, so i changed line 10 to be&lt;br/&gt;
 `db.GetCollection...` instead of `client.GetCollection...`&lt;br/&gt;
 &lt;span class=&quot;error&quot;&gt;&amp;#91;image: image.png&amp;#93;&lt;/span&gt;&lt;br/&gt;
 And it still hangs up RoslynPad. I even tried taking all of the other&lt;br/&gt;
 params off the connection string after the /test path and it does the same&lt;br/&gt;
 thing.&lt;br/&gt;
 &lt;span class=&quot;error&quot;&gt;&amp;#91;image: image.png&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="3624373" author="james.kovacs" created="Fri, 19 Feb 2021 00:50:53 +0000"  >&lt;p&gt;Hi, Andrew,&lt;/p&gt;

&lt;p&gt;Unclear why you&apos;re having problems commenting on JIRA tickets. I checked your permissions and you&apos;re part of &lt;tt&gt;jira-users&lt;/tt&gt;, which has sufficient privileges to comment. The email processor got your comment to the right place. So you can use that for now.&lt;/p&gt;

&lt;p&gt;When I tried the 2.11.6 driver (and other versions except 2.9.0) in RoslynPad 15.1, I did not need to dispose of the cluster in order for the running indicator to stop. When you create a MongoClient, background threads are spun up to monitor your cluster nodes but these will not prevent a program from exiting. Here is my complete sample app:&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;#r &quot;nuget:MongoDB.Driver/2.11.6&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;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&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;using MongoDB.Bson;&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;using MongoDB.Driver;&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;&amp;nbsp;&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;var client = new MongoClient(&quot;mongodb+srv://&amp;lt;&amp;lt;USER&amp;gt;&amp;gt;:&amp;lt;&amp;lt;PWD&amp;gt;&amp;gt;@&amp;lt;&amp;lt;ATLAS_CLUSTER_FQDN&amp;gt;&amp;gt;/test&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;   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;var db = client.GetDatabase(&quot;test&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;   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;var coll = client.GetCollection&amp;lt;BsonDocument&amp;gt;(&quot;coll&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;   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;foreach (var doc in coll.Find(new BsonDocument()).ToList()) {&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;    Console.WriteLine(doc);&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;}&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;All done&quot;.Dump();&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;&amp;lt;&amp;lt;USER&amp;gt;&amp;gt;, &amp;lt;PWD&amp;gt;&amp;gt;, and &amp;lt;&amp;lt;ATLAS_CLUSTER_FQDN&amp;gt;&amp;gt; must be replaced with your information of course.&lt;/p&gt;

&lt;p&gt;You mentioned that over 200 tasks are running when you examined the running tasks in Visual Studio. We use asynchronous tasks for cluster node monitoring and we would expect approximately as many tasks as you have nodes in your cluster. So 200+ awaiting tasks is rather unexpected for your simple program. The next step would be to collect a process dump for further analysis.&lt;/p&gt;

&lt;p&gt;1. Install &lt;tt&gt;dotnet-dump&lt;/tt&gt;:&lt;br/&gt;
    &lt;tt&gt;dotnet tool install --global dotnet-dump&lt;/tt&gt;&lt;br/&gt;
2. Launch RoslynPad.&lt;br/&gt;
3. Find the PID of RoslynPad.&lt;br/&gt;
    &lt;tt&gt;(get-process -name RoslynPad).Id&lt;/tt&gt;&lt;br/&gt;
4. Collect a process dump once :&lt;br/&gt;
    &lt;tt&gt;dotnet dump collect -p &amp;lt;&amp;lt;PID&amp;gt;&amp;gt; --type Full&lt;/tt&gt; &lt;br/&gt;
5. Attach all generated dump files (typically &lt;tt&gt;./core_&lt;b&gt;&lt;/tt&gt;  (Linux) or &lt;tt&gt;./dump_&lt;/b&gt;.dmp&lt;/tt&gt; (Windows)) to this ticket.&lt;/p&gt;

&lt;p&gt;Note that this will collect a full dump of the process including stack and heap memory. Please use a temporary password created specifically for this test to avoid revealing sensitive credentials.&lt;/p&gt;

&lt;p&gt;We look forward to investigating this issue further with your assistance.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br/&gt;
James&lt;/p&gt;</comment>
                            <comment id="3618509" author="JIRAUSER1258703" created="Wed, 17 Feb 2021 01:58:02 +0000"  >&lt;p&gt;First, thanks for reading and I apologize for not responding on the ticket,&lt;br/&gt;
but I dont seem to be able to type in the comments or description fields on&lt;br/&gt;
your JIRA system from either my work or home PC&apos;s. So I hope the email&lt;br/&gt;
processor can stick this on the JIRA ticket. The JIRA we use at my&lt;br/&gt;
workplace doesnt have an issue, so its probably account related. Anyway...&lt;/p&gt;

&lt;p&gt;2.11.6 was the driver version I was trying to use and that doesn&apos;t shut&lt;br/&gt;
down. I then went to 2.0 and it worked, so I split-half until I found that&lt;br/&gt;
2.9.0 was the culprit.  Note the &quot;running&quot; indicator still moving in the&lt;br/&gt;
screenshot.&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;image: image.png&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;This Roslynpad example does stop if I uncomment the cluster disposal, but&lt;br/&gt;
that doesnt work for the full program. I had to add an Environment.Exit(0)&lt;br/&gt;
to it, which is an OK workaround.  There is more information in the&lt;br/&gt;
original report in the community forums (&lt;br/&gt;
&lt;a href=&quot;https://developer.mongodb.com/community/forums/t/simple-c-console-program-wont-close-after-var-mc-new-mongoclient-connstr/15934&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://developer.mongodb.com/community/forums/t/simple-c-console-program-wont-close-after-var-mc-new-mongoclient-connstr/15934&lt;/a&gt;)&lt;br/&gt;
from VS when I pause the program after it should have exited.&lt;br/&gt;
.&lt;/p&gt;


&lt;p&gt;On Tue, Feb 16, 2021 at 6:57 PM James Kovacs (Jira) &amp;lt;jira@mongodb.org&amp;gt;&lt;/p&gt;
</comment>
                            <comment id="3618433" author="james.kovacs" created="Tue, 16 Feb 2021 23:56:26 +0000"  >&lt;p&gt;Hi, Andrew,&lt;/p&gt;

&lt;p&gt;Thank you for reaching out to us. We understand that your provided sample program causes RoslynPad to not terminate execution on completion of the program and similar behaviour is observed in Visual Studio.&lt;/p&gt;

&lt;p&gt;We have tested your sample program in RosalynPad with a variety of .NET/C# driver versions, including 2.8.1, 2.9.0, 2.9.1, 2.11.6, and others. The sample program only fails with 2.9.0, which suffers from a known bug &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2697&quot; title=&quot;mongodb+srv connection string no longer works with version 2.9.0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2697&quot;&gt;&lt;del&gt;CSHARP-2697&lt;/del&gt;&lt;/a&gt; preventing connectivity using `mongodb+srv://` connection strings.&lt;/p&gt;

&lt;p&gt;Please try another version of the driver such as 2.11.6 (latest) to verify that it works correctly with RosalynPad.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br/&gt;
James&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="900060">CSHARP-2697</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="301520" name="image.png" size="33948" author="astanton1978@gmail.com" created="Wed, 24 Feb 2021 15:04:02 +0000"/>
                            <attachment id="301521" name="image.png" size="15281" author="astanton1978@gmail.com" created="Wed, 24 Feb 2021 15:04:02 +0000"/>
                            <attachment id="300317" name="image.png" size="18483" author="astanton1978@gmail.com" created="Wed, 17 Feb 2021 01:58:02 +0000"/>
                            <attachment id="300291" name="mongoClient hangs program.csx" size="1172" author="astanton1978@gmail.com" created="Tue, 16 Feb 2021 21:36:55 +0000"/>
                    </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_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000tTBPVQA4]]]></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|hygvs7:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>