Преглед на файлове

HPCC-17450 Thor leaks globally-cached MySQL connections

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman преди 8 години
родител
ревизия
72860f1ad3
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  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);
 }