Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4513

Problem with MonitorServer heartbeat threads.

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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:

      1. Create MongoClient with connection to some server/cluster.
      2. Delete MongoClient (MongoClient is out of scope and maybe will be destroyed sometimes when GC will decide)
      3. 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.

            Assignee:
            james.kovacs@mongodb.com James Kovacs
            Reporter:
            semyon@365scores.com Semyon Pivovarov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: