Browse Source

HPCC-17450 Thor leaks globally-cached MySQL connections

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 years ago
parent
commit
72860f1ad3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      plugins/mysql/mysqlembed.cpp

+ 2 - 1
plugins/mysql/mysqlembed.cpp

@@ -427,7 +427,7 @@ public:
         ForEachItemInRev(idx, globalCachedConnections)
         {
             MySQLConnection &cached = globalCachedConnections.item(idx);
-            if (now - cached.created > maxAge)
+            if (!maxAge || (now - cached.created > maxAge))
             {
                 cached.globalCached = false;  // Make sure we don't re-add it!
                 globalCachedConnections.remove(idx);
@@ -488,6 +488,7 @@ MODULE_EXIT()
         connectionCloserThread->join();
         connectionCloserThread->Release();
     }
+    MySQLConnection::retireCache(0);
 }