Merge pull request #8277 from Icinga/bugfix/latency-8196

Call Process::InitializeSpawnHelper() ASAP
This commit is contained in:
Alexander Aleksandrovič Klimov 2020-10-16 16:49:06 +02:00 committed by GitHub
commit 4926353269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,7 @@
#include "base/defer.hpp"
#include "base/logger.hpp"
#include "base/application.hpp"
#include "base/process.hpp"
#include "base/timer.hpp"
#include "base/utility.hpp"
#include "base/exception.hpp"
@ -509,6 +510,14 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs, bool close
_exit(EXIT_FAILURE);
}
try {
Process::InitializeSpawnHelper();
} catch (const std::exception& ex) {
Log(LogCritical, "cli")
<< "Failed to initialize process spawn helper after forking (child): " << DiagnosticInformation(ex);
_exit(EXIT_FAILURE);
}
_exit(RunWorker(configs, closeConsoleLog, stderrFile));
} catch (...) {
_exit(EXIT_FAILURE);