소스 검색

Merge branch 'candidate-7.12.x' into candidate-8.0.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 4 년 전
부모
커밋
24f133a1b3

+ 1 - 1
.github/workflows/smoketest.yml

@@ -256,7 +256,7 @@ jobs:
     - name: Cache miss prep
       if: ${{ steps.check-cache.outputs.state == 'miss' }}
       run: |
-        rm -rf build merge-patch src-cache
+        rm -rf build build-cache merge-patch src-cache
         mkdir build
         mkdir src-cache
         cd src

+ 6 - 4
esp/src/src/ECLArchiveWidget.ts

@@ -104,14 +104,17 @@ export class ECLArchiveWidget {
             return ret;
         };
 
+        this.archiveViewer
+            .target(context.id + "EclContent")
+            ;
+
         const wu = Workunit.attach({ baseUrl: "" }, params.Wuid);
         wu.fetchQuery().then(function (query) {
             context.editor.text(query.Text);
             if (!wu.HasArchiveQuery) {
                 context.archiveViewer
-                    .target(context.id + "EclContent")
                     .addWidget(context.editor)
-                    .render()
+                    .lazyRender()
                     ;
             } else {
                 context.directoryTree
@@ -128,11 +131,10 @@ export class ECLArchiveWidget {
                     .rowItemPadding(2)
                     ;
                 context.archiveViewer
-                    .target(context.id + "EclContent")
                     .addWidget(context.directoryTree)
                     .addWidget(context.editor)
                     .relativeSizes([0.1, 0.9])
-                    .render()
+                    .lazyRender()
                     ;
                 const scopesOptions = {
                     ScopeFilter: {

+ 1 - 0
roxie/ccd/ccd.hpp

@@ -337,6 +337,7 @@ extern bool prestartAgentThreads;
 extern unsigned preabortKeyedJoinsThreshold;
 extern unsigned preabortIndexReadsThreshold;
 extern bool traceStartStop;
+extern unsigned actResetLogPeriod;
 extern bool traceRoxiePackets;
 extern bool delaySubchannelPackets;
 extern bool traceTranslations;

+ 32 - 0
roxie/ccd/ccdcontext.cpp

@@ -2538,6 +2538,8 @@ public:
 
 };
 
+enum LogActReset { LogResetSkip=0, LogResetOK, LogResetInit };
+
 class CRoxieServerContext : public CRoxieContextBase, implements IRoxieServerContext, implements IGlobalCodeContext, implements IEngineContext
 {
     const IQueryFactory *serverQueryFactory = nullptr;
@@ -2562,6 +2564,7 @@ protected:
     bool isBlocked;
     bool isNative;
     bool trim;
+    LogActReset actResetLogState = LogResetInit;
 
     void doPostProcess()
     {
@@ -3933,6 +3936,35 @@ public:
         clusterNames.pop();
         clusterWidth = -1;
     }
+
+    virtual bool okToLogStartStopError()
+    {
+        // Each query starts with actResetLogState set to LogResetInit
+        // State is changed to LogResetOK and a timer is started
+        // If same query runs again then time since last logged is checked
+        // If two of the same query run at the same time and it is
+        // past the logging skip period then both will log activity reset msgs
+        if (actResetLogState == LogResetInit)
+        {
+            unsigned timeNow = msTick();
+            unsigned timePrev = serverQueryFactory->getTimeActResetLastLogged();
+            if ((timeNow - timePrev) > (actResetLogPeriod*1000))
+            {
+                serverQueryFactory->setTimeActResetLastLogged(timeNow);
+                actResetLogState = LogResetOK;
+                return true;
+            }
+            else
+            {
+                actResetLogState = LogResetSkip;
+                return false;
+            }
+        }
+        else if (actResetLogState == LogResetOK)
+            return true;
+        else
+            return false;
+    }
 };
 
 //================================================================================================

+ 1 - 0
roxie/ccd/ccdcontext.hpp

@@ -92,6 +92,7 @@ interface IRoxieServerContext : extends IInterface
     virtual IConstWorkUnit *queryWorkUnit() const = 0;
     virtual const IQueryFactory *queryQueryFactory() const = 0;
     virtual bool outputResultsToSocket() const = 0;
+    virtual bool okToLogStartStopError() = 0;
 
     virtual IRoxieDaliHelper *checkDaliConnection() = 0;
     virtual const IProperties *queryXmlns(unsigned seqNo) = 0;

+ 2 - 0
roxie/ccd/ccdmain.cpp

@@ -81,6 +81,7 @@ unsigned maxBlockSize = 10000000;
 unsigned maxLockAttempts = 5;
 bool pretendAllOpt = false;
 bool traceStartStop = false;
+unsigned actResetLogPeriod = 300;
 bool traceRoxiePackets = false;
 bool delaySubchannelPackets = false;    // For debugging/testing purposes only
 bool defaultTimeActivities = true;
@@ -1057,6 +1058,7 @@ int CCD_API roxie_main(int argc, const char *argv[], const char * defaultYaml)
         roxiemem::setTotalMemoryLimit(allowHugePages, allowTransparentHugePages, retainMemory, totalMemoryLimit, 0, NULL, NULL);
 
         traceStartStop = topology->getPropBool("@traceStartStop", false);
+        actResetLogPeriod = topology->getPropInt("@actResetLogPeriod", 300);
         watchActivityId = topology->getPropInt("@watchActivityId", 0);
         traceRoxiePackets = topology->getPropBool("@traceRoxiePackets", false);
         delaySubchannelPackets = topology->getPropBool("@delaySubchannelPackets", false);

+ 13 - 0
roxie/ccd/ccdquery.cpp

@@ -564,6 +564,8 @@ protected:
     unsigned libraryInterfaceHash;
     hash64_t hashValue;
 
+    mutable unsigned timeActResetLastLogged;
+
     static CriticalSection activeQueriesCrit;
     static CopyMapXToMyClass<hash64_t, hash64_t, CQueryFactory> activeQueries;    // Active queries
     static CopyMapXToMyClass<hash64_t, hash64_t, CQueryFactory> queryCache;       // Active and loading queries
@@ -1136,6 +1138,7 @@ public:
         libraryInterfaceHash = 0;
         options.enableFieldTranslation = package.getEnableFieldTranslation();  // NOTE - can be overridden by wu settings
         options.allSortsMaySpill = dynamic;
+        timeActResetLastLogged = 0;
         addToCache();
     }
 
@@ -1660,6 +1663,16 @@ static hash64_t getQueryHash(const char *id, const IQueryDll *dll, const IRoxieP
         return dynamic;
     }
 
+    virtual unsigned getTimeActResetLastLogged() const override
+    {
+        return timeActResetLastLogged;
+    }
+
+    virtual void setTimeActResetLastLogged(unsigned _ntime) const override
+    {
+        timeActResetLastLogged = _ntime;
+    }
+
 protected:
     IPropertyTree *queryWorkflowTree() const
     {

+ 2 - 0
roxie/ccd/ccdquery.hpp

@@ -168,6 +168,8 @@ interface IQueryFactory : extends IInterface
     virtual IQueryFactory *lookupLibrary(const char *libraryName, unsigned expectedInterfaceHash, const IRoxieContextLogger &logctx) const = 0;
     virtual void getQueryInfo(StringBuffer &result, bool full, IArrayOf<IQueryFactory> *agentQueries,const IRoxieContextLogger &logctx) const = 0;
     virtual bool isDynamic() const = 0;
+    virtual unsigned getTimeActResetLastLogged() const = 0;
+    virtual void setTimeActResetLastLogged(unsigned _ntime) const = 0;
     virtual void checkSuspended() const = 0;
     virtual void onTermination(TerminationCallbackInfo *info) const= 0;
 };

+ 5 - 2
roxie/ccd/ccdserver.cpp

@@ -1483,8 +1483,11 @@ public:
             {
                 if (state==STATEstarted || state==STATEstarting)
                 {
-                    VStringBuffer err("STATE: activity %d reset without stop", activityId);
-                    ctx->queryCodeContext()->addWuException(err.str(), ROXIE_INTERNAL_ERROR, SeverityError, "roxie");
+                    if (ctx->queryServerContext()->okToLogStartStopError()) // && traceLevel ?
+                    {
+                        VStringBuffer err("STATE: activity %d reset without stop", activityId);
+                        ctx->queryCodeContext()->addWuException(err.str(), ROXIE_INTERNAL_ERROR, SeverityError, "roxie");
+                    }
                     if (ctx->queryOptions().failOnLeaks)
                         throw makeStringExceptionV(ROXIE_INTERNAL_ERROR, "STATE: activity %d reset without stop", activityId);
                     try