瀏覽代碼

Merge pull request #15572 from ghalliday/issue26814

HPCC-26814 Avoid potential race condition in ~CReceiveManager

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 年之前
父節點
當前提交
3efcadcc96
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      roxie/udplib/udptrr.cpp

+ 12 - 2
roxie/udplib/udptrr.cpp

@@ -819,8 +819,18 @@ class CReceiveManager : implements IReceiveManager, public CInterface
     {
         while(running) 
         {
-            DataBuffer *dataBuff = input_queue->pop(true);
-            collatePacket(dataBuff);
+            try
+            {
+                DataBuffer *dataBuff = input_queue->pop(true);
+                collatePacket(dataBuff);
+            }
+            catch (IException * e)
+            {
+                //An interrupted semaphore exception is expected at closedown - anything else should be reported
+                if (!dynamic_cast<InterruptedSemaphoreException *>(e))
+                    EXCLOG(e);
+                e->Release();
+            }
         }
     }