Browse Source

HPCC-15945 Thor slave hang in countproject

If a slave countproject calls stop() before nextRow()
(ie if one slave hits CHOSEN limit others will be told to stop)
a deadlock could occur.  This change moves PARENT::stop() call to
after check for first in stop() so that signalNext() can signal
the semaphore inInputFinished() is waiting for.  Thus PARENT::stop()
does not deadlock waiting for onInputFinished to end.

Signed-off-by: Mark Kelly <mark.kelly@lexisnexis.com>
Mark Kelly 9 years ago
parent
commit
909e1e20c7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      thorlcr/activities/countproject/thcountprojectslave.cpp

+ 1 - 1
thorlcr/activities/countproject/thcountprojectslave.cpp

@@ -167,12 +167,12 @@ public:
     }
     virtual void stop()
     {
-        PARENT::stop();
         if (first) // nextRow, therefore getPrevCount()/sendCount() never called
         {
             prevRecCount = count = getPrevCount();
             signalNext();
         }
+        PARENT::stop();
     }
     virtual void abort()
     {