Browse Source

Merge branch 'candidate-5.6.0' into candidate-6.0.0

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 years ago
parent
commit
747a1a9445

+ 8 - 0
ecl/eclcc/eclcc.cpp

@@ -475,7 +475,15 @@ int main(int argc, const char *argv[])
     queryLogMsgManager()->changeMonitorFilter(queryStderrLogMsgHandler(), filter);
 
     unsigned exitCode = doMain(argc, argv);
+
+#ifndef _DEBUG
+    //In release mode exit without calling all the clean up code.
+    //It is faster, and it helps avoids potential crashes if there are active objects which depend on objects in file hook dlls.
+    _exit(exitCode);
+#endif
+
     releaseAtoms();
+    ClearTypeCache();   // Clear this cache before the file hooks are unloaded
     removeFileHooks();
     return exitCode;
 }

+ 3 - 3
ecl/eclccserver/vchooks/git.sh

@@ -114,10 +114,10 @@ function fetch_repo {
     if [ -n "$fetch_needed" ]; then
         if [ -n "$GIT_VERBOSE" ]; then
             echo "GIT: using directory $git_directory" 1>&2
-            echo "GIT: Running git fetch $git_url" 1>&2
-            git fetch $git_url 1>&2
+            echo "GIT: Running git fetch $git_url +refs/heads/*:refs/heads/* --prune" 1>&2
+            git fetch $git_url +refs/heads/*:refs/heads/* --prune 1>&2
         else
-            git fetch $git_url 2>&1 >/dev/null
+            git fetch $git_url +refs/heads/*:refs/heads/* --prune 2>&1 >/dev/null
         fi
         if [ $? -ne 0 ]; then
             echo "Failed to run git fetch $git_url" 1>&2

+ 0 - 2
ecl/hql/hqlexpr.cpp

@@ -283,8 +283,6 @@ MODULE_EXIT()
     cachedNullRecord->Release();
     nullType->Release();
 
-    ClearTypeCache();
-
 #ifdef _REPORT_EXPRESSION_LEAKS
     if (exprCache->count())
     {

+ 37 - 28
esp/services/ws_workunits/ws_workunitsQuerySets.cpp

@@ -972,28 +972,32 @@ void retrieveQuerysetDetailsFromAlias(IEspContext &context, IPropertyTree *regis
 {
     StringBuffer xpath;
     xpath.append("Alias[@name='").append(name).append("']");
-    IPropertyTree *alias = registry->queryPropTree(xpath);
-    if (!alias)
+    Owned<IPropertyTreeIterator> regAliases = registry->getElements(xpath.str());
+    if (!regAliases->first())
     {
         DBGLOG("Alias %s not found", name);
         return;
     }
 
-    Owned<IEspQuerySetAlias> a = createQuerySetAlias();
-    gatherQuerySetAliasDetails(alias, a);
-    xpath.clear().append("Query[@id='").append(a->getId()).append("']");
-    aliases.append(*a.getClear());
-
-    IPropertyTree *query = registry->queryPropTree(xpath);
-    if (!query)
+    ForEach(*regAliases)
     {
-        DBGLOG("No matching Query %s found for Alias %s", a->getId(), name);
-        return;
-    }
+        IPropertyTree& alias = regAliases->query();
+        Owned<IEspQuerySetAlias> a = createQuerySetAlias();
+        gatherQuerySetAliasDetails(&alias, a);
+        xpath.clear().append("Query[@id='").append(a->getId()).append("']");
+        aliases.append(*a.getClear());
 
-    Owned<IEspQuerySetQuery> q = createQuerySetQuery();
-    gatherQuerySetQueryDetails(context, query, q, cluster, queriesOnCluster);
-    queries.append(*q.getClear());
+        IPropertyTree *query = registry->queryPropTree(xpath);
+        if (!query)
+        {
+            DBGLOG("No matching Query %s found for Alias %s", a->getId(), name);
+            return;
+        }
+
+        Owned<IEspQuerySetQuery> q = createQuerySetQuery();
+        gatherQuerySetQueryDetails(context, query, q, cluster, queriesOnCluster);
+        queries.append(*q.getClear());
+    }
 }
 
 void retrieveQuerysetDetailsFromQuery(IEspContext &context, IPropertyTree *registry, const char *value, const char *type, IArrayOf<IEspQuerySetQuery> &queries, IArrayOf<IEspQuerySetAlias> &aliases, const char *cluster=NULL, IPropertyTree *queriesOnCluster=NULL)
@@ -1004,25 +1008,30 @@ void retrieveQuerysetDetailsFromQuery(IEspContext &context, IPropertyTree *regis
     StringBuffer attributeName(type);
     StringBuffer xpath;
     xpath.clear().append("Query[@").append(attributeName.toLowerCase()).append("='").append(value).append("']");
-    IPropertyTree *query = registry->queryPropTree(xpath);
-    if (!query)
+    Owned<IPropertyTreeIterator> regQueries = registry->getElements(xpath.str());
+    if (!regQueries->first())
     {
         DBGLOG("No matching Query %s found for %s", value, type);
         return;
     }
 
-    Owned<IEspQuerySetQuery> q = createQuerySetQuery();
-    gatherQuerySetQueryDetails(context, query, q, cluster, queriesOnCluster);
-    xpath.clear().append("Alias[@id='").append(q->getId()).append("']");
-    queries.append(*q.getClear());
-
-    Owned<IPropertyTreeIterator> regAliases = registry->getElements(xpath.str());
-    ForEach(*regAliases)
+    ForEach(*regQueries)
     {
-        IPropertyTree &alias = regAliases->query();
-        Owned<IEspQuerySetAlias> a = createQuerySetAlias();
-        gatherQuerySetAliasDetails(&alias, a);
-        aliases.append(*a.getClear());
+        IPropertyTree& query = regQueries->query();
+
+        Owned<IEspQuerySetQuery> q = createQuerySetQuery();
+        gatherQuerySetQueryDetails(context, &query, q, cluster, queriesOnCluster);
+        xpath.clear().append("Alias[@id='").append(q->getId()).append("']");
+        queries.append(*q.getClear());
+
+        Owned<IPropertyTreeIterator> regAliases = registry->getElements(xpath.str());
+        ForEach(*regAliases)
+        {
+            IPropertyTree &alias = regAliases->query();
+            Owned<IEspQuerySetAlias> a = createQuerySetAlias();
+            gatherQuerySetAliasDetails(&alias, a);
+            aliases.append(*a.getClear());
+        }
     }
 }
 

+ 1 - 0
esp/src/eclwatch/DFUQueryWidget.js

@@ -446,6 +446,7 @@ define([
             this.listStore = this.params.searchResults ? this.params.searchResults : new ESPLogicalFile.CreateLFQueryStore();
             this.treeStore = new ESPLogicalFile.CreateLFQueryTreeStore();
             this.workunitsGrid = new declare([ESPUtil.Grid(true, true)])({
+                deselectOnRefresh: true,
                 store: this.listStore,
                 columns: {
                     col1: selector({

+ 29 - 28
thorlcr/activities/enth/thenthslave.cpp

@@ -27,11 +27,10 @@ protected:
     rowcount_t counter, localRecCount;
     rowcount_t denominator, numerator;
     Owned<IThorDataLink> input;
-    bool localCountReq;
 
     bool haveLocalCount() { return RCUNBOUND != localRecCount; }
     inline bool wanted()
-    {       
+    {
         counter += numerator;
         if(counter >= denominator)
         {
@@ -66,13 +65,31 @@ protected:
         ActPrintLog("%s: Initial value of counter %" RCPF "d", actStr.str(), counter);
 #endif
     }
-
+    void setLocalCountReq()
+    {
+        ThorDataLinkMetaInfo info;
+        input->getMetaInfo(info);
+        // Need lookahead _unless_ row count pre-known.
+        if (0 == numerator)
+            localRecCount = 0;
+        else if (info.totalRowsMin == info.totalRowsMax)
+        {
+            localRecCount = (rowcount_t)info.totalRowsMax;
+            ActPrintLog("%s: row count pre-known to be %" RCPF "d", actStr.str(), localRecCount);
+        }
+        else
+        {
+            localRecCount = RCUNBOUND;
+            input.setown(createDataLinkSmartBuffer(this, input,ENTH_SMART_BUFFER_SIZE,true,false,RCUNBOUND,this,true,&container.queryJob().queryIDiskUsage()));
+            StringBuffer tmpStr(actStr);
+            startInput(input);
+        }
+    }
 public:
     IMPLEMENT_IINTERFACE_USING(CSimpleInterface);
 
     BaseEnthActivity(CGraphElementBase *_container) : CSlaveActivity(_container), CThorDataLink(this)
     {
-        localCountReq = false;
     }
     ~BaseEnthActivity()
     {
@@ -91,27 +108,6 @@ public:
         input.set(inputs.item(0));
         startInput(input);
         dataLinkStart();
-
-        if (localCountReq)
-        {
-            ThorDataLinkMetaInfo info;
-            input->getMetaInfo(info);
-            // Need lookahead _unless_ row count pre-known.
-            if (0 == numerator)
-                localRecCount = 0;
-            else if (info.totalRowsMin == info.totalRowsMax)
-            {
-                localRecCount = (rowcount_t)info.totalRowsMax;
-                ActPrintLog("%s: row count pre-known to be %" RCPF "d", actStr.str(), localRecCount);
-            }
-            else
-            {
-                localRecCount = RCUNBOUND;
-                input.setown(createDataLinkSmartBuffer(this, input,ENTH_SMART_BUFFER_SIZE,true,false,RCUNBOUND,this,true,&container.queryJob().queryIDiskUsage()));
-                StringBuffer tmpStr(actStr);
-                startInput(input);
-            }
-        }
     }
     virtual void stop()
     {
@@ -134,16 +130,21 @@ public:
 
 class CLocalEnthSlaveActivity : public BaseEnthActivity
 {
+    bool localCountReq;
 public:
     CLocalEnthSlaveActivity(CGraphElementBase *container) : BaseEnthActivity(container)
     {
         actStr.append("LOCALENTH");
+        localCountReq = false;
     }
-    virtual void init(MemoryBuffer & data, MemoryBuffer &slaveData)
+    virtual void start()
     {
-        BaseEnthActivity::init(data, slaveData);
+        BaseEnthActivity::start();
         if (RCUNBOUND == denominator)
+        {
             localCountReq = true;
+            setLocalCountReq();
+        }
         else
             setInitialCounter(0);
     }
@@ -219,7 +220,6 @@ class CEnthSlaveActivity : public BaseEnthActivity
 public:
     CEnthSlaveActivity(CGraphElementBase *container) : BaseEnthActivity(container)
     { 
-        localCountReq = true;
         actStr.append("ENTH");
     }
     virtual void init(MemoryBuffer & data, MemoryBuffer &slaveData)
@@ -232,6 +232,7 @@ public:
         BaseEnthActivity::start();
         prevRecCount = 0;
         first = true;
+        setLocalCountReq();
     }
     virtual void abort()
     {