libmongoclient should not link db/commands.cpp

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      All
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      libmongoclient links db/commands.o (via the coreDbFiles variable in SConstruct) into the client library. It does that only so it can define two new commands (connPoolSync and connPoolStats) in client/connpool.cpp. Since Command objects are held by raw pointer in a static map, these objects are never collected during fini processing for libmongoclient. As a result, client code that links libmongoclient will show (real) memory leaks when run under Purify or valgrind.

      The two commands should be moved to db/commands.cpp, which can be done easily since the global 'pool' object on which they depend is exposed in the connpool.h header, and the db/commands.o file should be removed from the link list for libmongoclient

              Assignee:
              Andrew Morrow (Inactive)
              Reporter:
              Andrew Morrow (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: