瀏覽代碼

HPCC-11509 ESP cache of packagemap info leaking connections

A couple of uses of getPackageMapById leaked the resulting Dali connection and
thus left the packagemap locked.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 年之前
父節點
當前提交
b10b2c4dde
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 1
      common/workunit/pkgimpl.hpp
  2. 2 1
      esp/services/ws_packageprocess/ws_packageprocessService.cpp

+ 2 - 1
common/workunit/pkgimpl.hpp

@@ -382,7 +382,8 @@ public:
 
     void load(const char *id)
     {
-        load(getPackageMapById(id, true));
+        Owned<IPropertyTree> xml = getPackageMapById(id, true);
+        load(xml);
     }
 
     virtual void gatherFileMappingForQuery(const char *queryname, IPropertyTree *fileInfo) const

+ 2 - 1
esp/services/ws_packageprocess/ws_packageprocessService.cpp

@@ -931,7 +931,8 @@ bool CWsPackageProcessEx::onGetQueryFileMapping(IEspContext &context, IEspGetQue
     const char *pmid = req.getPMID();
     if (pmid && *pmid)
     {
-        ownedmap.setown(createPackageMapFromPtree(getPackageMapById(req.getGlobalScope() ? NULL : target, pmid, true), target, pmid));
+        Owned<IPropertyTree> pm = getPackageMapById(req.getGlobalScope() ? NULL : target, pmid, true);
+        ownedmap.setown(createPackageMapFromPtree(pm, target, pmid));
         if (!ownedmap)
             throw MakeStringException(PKG_LOAD_PACKAGEMAP_FAILED, "Error loading package map %s", req.getPMID());
         map = ownedmap;