浏览代码

HPCC-11477 Activities are being reset excessively

Worked out why it is not safe to ignore stops for activities that are in reset
state (they are needed by splitters).

Regression suite and RW query now both execute with no state errors.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 年之前
父节点
当前提交
c5465e346d
共有 1 个文件被更改,包括 16 次插入10 次删除
  1. 16 10
      roxie/ccd/ccdserver.cpp

+ 16 - 10
roxie/ccd/ccdserver.cpp

@@ -1237,21 +1237,22 @@ public:
 
 
     inline void stop(bool aborting)
     inline void stop(bool aborting)
     {
     {
-        if (state != STATEstopped && state != STATEreset)
+        // NOTE - don't be tempted to skip the stop for activities that are reset - splitters need to see the stops
+        if (state != STATEstopped)
         {
         {
             CriticalBlock cb(statecrit);
             CriticalBlock cb(statecrit);
-#ifdef TRACE_STARTSTOP
-            if (traceStartStop)
+            if (state != STATEstopped)
             {
             {
-                CTXLOG("stop %p %d (state currently %s)", this, activityId, queryStateText(state));
-                if (watchActivityId && watchActivityId==activityId)
+#ifdef TRACE_STARTSTOP
+                if (traceStartStop)
                 {
                 {
-                    CTXLOG("WATCH: stop %p %d", this, activityId);
+                    CTXLOG("stop %p %d (state currently %s)", this, activityId, queryStateText(state));
+                    if (watchActivityId && watchActivityId==activityId)
+                    {
+                        CTXLOG("WATCH: stop %p %d", this, activityId);
+                    }
                 }
                 }
-            }
 #endif
 #endif
-            if (state != STATEstopped && state != STATEreset)
-            {
                 state=STATEstopped;
                 state=STATEstopped;
                 // NOTE - this is needed to ensure that dependencies which were not used are properly stopped
                 // NOTE - this is needed to ensure that dependencies which were not used are properly stopped
                 ForEachItemIn(idx, dependencies)
                 ForEachItemIn(idx, dependencies)
@@ -15172,7 +15173,12 @@ public:
         {
         {
             CRoxieServerActivity::reset();
             CRoxieServerActivity::reset();
             libraryGraph->reset();
             libraryGraph->reset();
-            //Call reset on all unused outputs from the graph - no one else will.
+            //Call reset on all unused inputs/outputs from the graph - no one else will.
+            for (unsigned i1 = 0; i1 < numInputs; i1++)
+            {
+                if (!inputUsed[i1])
+                    inputAdaptors[i1]->reset();
+            }
             IRoxieServerChildGraph * graph = libraryGraph->queryLoopGraph();
             IRoxieServerChildGraph * graph = libraryGraph->queryLoopGraph();
             ForEachItemIn(i3, extra.unusedOutputs)
             ForEachItemIn(i3, extra.unusedOutputs)
             {
             {