فهرست منبع

HPCC-21469 Prevent splitter stop state getting out of sync

If a downstream activity called stop on the same input >1, then
the stop count/state could get out of sync, causing the input
to stop prematurely, and/or the input to be restarted and then
not stopped on the next iteration of the subgraph if within a
child graph.

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 6 سال پیش
والد
کامیت
961de1a655
2فایلهای تغییر یافته به همراه9 افزوده شده و 6 حذف شده
  1. 2 1
      thorlcr/activities/nsplitter/thnsplitterslave.cpp
  2. 7 5
      thorlcr/graph/thgraphslave.hpp

+ 2 - 1
thorlcr/activities/nsplitter/thnsplitterslave.cpp

@@ -346,7 +346,6 @@ public:
             {
                 writer.stop();
                 PARENT::stop();
-                inputPrepared = false;
             }
         }
     }
@@ -462,6 +461,8 @@ void CSplitterOutput::start()
 // IEngineRowStream
 void CSplitterOutput::stop()
 { 
+    if (stopped)
+        return;
     stopped = true;
     activity.inputStopped(outIdx);
     dataLinkStop();

+ 7 - 5
thorlcr/graph/thgraphslave.hpp

@@ -65,11 +65,13 @@ public:
 #ifdef _TESTING
         owner.ActPrintLog("ITDL starting for output %d", outputId);
 #endif
-#ifdef _TESTING
-        bool started = hasStarted();
-        bool stopped = hasStopped();
-        assertex(!hasStarted() || hasStopped());      // ITDL started twice
-#endif
+        if (hasStarted())
+        {
+            if (!hasStopped())
+                throw MakeActivityException(&owner, 0, "Starting without being stopped 1st");
+            else
+                throw MakeActivityException(&owner, 0, "Started and stopped states both set");
+        }
         icount = 0;
         count = (count & THORDATALINK_COUNT_MASK) | THORDATALINK_STARTED;
     }