-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Summary:
When you once created a client and created a connection to one server/cluster the thread that performs heartbeat (that lives in MongoDB.Driver.Core.Servers.MonitorServer class) will be working all the time before the application stop.
Version to reproduce:
From 2.15.0 (thread was added in https://jira.mongodb.org/browse/CSHARP-3761) to the latest (2.19.0).
How to Reproduce:
- Create MongoClient with connection to some server/cluster.
- Delete MongoClient (MongoClient is out of scope and maybe will be destroyed sometimes when GC will decide)
- We don't need Mongo connection, but the heartbeat thread is working. And we can't control it.
Additional Background:
That's how look threads list in our application after some time, there are 300+ threads created by MonitorServer and they never die.
A lot of connections exist which never close.
- duplicates
-
CSHARP-3431 Make MongoClient IDisposable
- Closed
- is related to
-
CSHARP-3761 Reimplement SDAM to use a dedicated thread
- Closed