فهرست منبع

Merge pull request #3395 from jakesmith/thread-start-retry

HPCC-7886 Issue warnings and retry on thread start timeout

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 سال پیش
والد
کامیت
f91ae19827
1فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 9 2
      system/jlib/jthread.cpp

+ 9 - 2
system/jlib/jthread.cpp

@@ -377,8 +377,15 @@ void Thread::startRelease()
         ERRLOG("Running threads:\n %s",s.str());
         throw MakeOsException(status);
     }
-    if (!starting.wait(1000*10))
-        throw MakeStringException(-1, "Thread::start(%s) failed",getName());
+    unsigned retryCount = 10;
+    loop
+    {
+        if (starting.wait(1000*10))
+            break;
+        else if (0 == --retryCount)
+            throw MakeStringException(-1, "Thread::start(%s) failed", getName());
+        WARNLOG("Thread::start(%s) stalled, waiting to start, retrying", getName());
+    }
 #endif
     alive = true;
     if (prioritydelta)