[CSHARP-3429] just declaring a `new MongoClient(connStr)` prevents my program from closing Created: 16/Feb/21 Updated: 28/Oct/23 Resolved: 26/Feb/21 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Internal |
| Affects Version/s: | 2.9.0, 2.11.6 |
| Fix Version/s: | 2.12.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Stanton | Assignee: | Boris Dogadov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 10 1909, VS 16.8.5, RoslynPad 15.1, dotnet core 3.1, .net 5 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Case: | (copied to CRM) | ||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Comments |
| Comment by Githook User [ 26/Feb/21 ] | ||||||||||||
|
Author: {'name': 'Boris', 'email': 'boris.dogadov@mongodb.com', 'username': 'BorisDog'}Message: | ||||||||||||
| Comment by Boris Dogadov [ 25/Feb/21 ] | ||||||||||||
|
Hi Andrew, | ||||||||||||
| Comment by Andrew Stanton [ 24/Feb/21 ] | ||||||||||||
|
Geez it is frustrating to not be able to add a comment. I could do it on at If you check the latest on that, another user found that this was a problem Your RoslynPad program does not compile as is, so i changed line 10 to be | ||||||||||||
| Comment by James Kovacs [ 19/Feb/21 ] | ||||||||||||
|
Hi, Andrew, Unclear why you're having problems commenting on JIRA tickets. I checked your permissions and you're part of jira-users, which has sufficient privileges to comment. The email processor got your comment to the right place. So you can use that for now. 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:
<<USER>>, <PWD>>, and <<ATLAS_CLUSTER_FQDN>> must be replaced with your information of course. 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. 1. Install dotnet-dump: 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. We look forward to investigating this issue further with your assistance. Sincerely, | ||||||||||||
| Comment by Andrew Stanton [ 17/Feb/21 ] | ||||||||||||
|
First, thanks for reading and I apologize for not responding on the ticket, 2.11.6 was the driver version I was trying to use and that doesn't shut This Roslynpad example does stop if I uncomment the cluster disposal, but On Tue, Feb 16, 2021 at 6:57 PM James Kovacs (Jira) <jira@mongodb.org> | ||||||||||||
| Comment by James Kovacs [ 16/Feb/21 ] | ||||||||||||
|
Hi, Andrew, 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. 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 Please try another version of the driver such as 2.11.6 (latest) to verify that it works correctly with RosalynPad. Sincerely, |