瀏覽代碼

Merge pull request #9494 from richardkchapman/workunit-wait-crash

HPCC-16885 Workunits don't check for unexpected failure until timeout

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 8 年之前
父節點
當前提交
65a479eeb5
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      common/workunit/workunit.cpp
  2. 2 2
      plugins/cassandra/cassandrawu.cpp

+ 2 - 2
common/workunit/workunit.cpp

@@ -3059,9 +3059,9 @@ public:
                 }
                 agentSessionStopped = false; // reset for state changes such as WUStateWait then WUStateRunning again
                 unsigned waited = msTick() - start;
-                if (timeout==-1)
+                if (timeout==-1 || waited + 20000 < timeout)
                 {
-                    waiter->wait(20000);  // recheck state every 20 seconds even if no timeout, in case eclagent has crashed.
+                    waiter->wait(20000);  // recheck state every 20 seconds, in case eclagent has crashed.
                     if (waiter->aborted)
                     {
                         ret = WUStateUnknown;  // MORE - throw an exception?

+ 2 - 2
plugins/cassandra/cassandrawu.cpp

@@ -3612,9 +3612,9 @@ public:
             }
             agentSessionStopped = false; // reset for state changes such as WUStateWait then WUStateRunning again
             unsigned waited = msTick() - start;
-            if (timeout==-1)
+            if (timeout==-1 || waited + 20000 < timeout)
             {
-                waiter->wait(20000);  // recheck state every 20 seconds even if no timeout, in case eclagent has crashed.
+                waiter->wait(20000);  // recheck state every 20 seconds, in case eclagent has crashed.
                 if (waiter->aborted)
                     return WUStateUnknown;  // MORE - throw an exception?
             }