Sfoglia il codice sorgente

Merge pull request #13303 from richardkchapman/aeron-startup

HPCC-23439 Roxie cores at startup if Aeron driver cannot initialize

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 5 anni fa
parent
commit
b313837f7a
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      roxie/udplib/udpaeron.cpp

+ 8 - 2
roxie/udplib/udpaeron.cpp

@@ -41,7 +41,7 @@ unsigned aeronPollFragmentsLimit = 10;
 unsigned aeronIdleSleepMs = 1;
 
 static std::thread aeronDriverThread;
-static Semaphore driverStarted;
+static InterruptableSemaphore driverStarted;
 
 std::atomic<bool> aeronDriverRunning = { false };
 
@@ -104,11 +104,17 @@ int startAeronDriver()
         aeron_driver_close(driver);
         aeron_driver_context_close(context);
     }
+    catch (IException *E)
+    {
+        aeron_driver_close(driver);
+        aeron_driver_context_close(context);
+        driverStarted.interrupt(E);
+    }
     catch (...)
     {
         aeron_driver_close(driver);
         aeron_driver_context_close(context);
-        throw;
+        driverStarted.interrupt(makeStringException(0, "failed to start Aeron (unknown exception)"));
     }
     return 0;
 }