Skip to content

Commit 41c3178

Browse files
authored
Merge pull request #8276 from Icinga/bugfix/latency-8196
Call Process::InitializeSpawnHelper() ASAP
2 parents 7a7726c + 177f930 commit 41c3178

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/cli/daemoncommand.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "base/defer.hpp"
1212
#include "base/logger.hpp"
1313
#include "base/application.hpp"
14+
#include "base/process.hpp"
1415
#include "base/timer.hpp"
1516
#include "base/utility.hpp"
1617
#include "base/exception.hpp"
@@ -508,6 +509,14 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs, bool close
508509
_exit(EXIT_FAILURE);
509510
}
510511

512+
try {
513+
Process::InitializeSpawnHelper();
514+
} catch (const std::exception& ex) {
515+
Log(LogCritical, "cli")
516+
<< "Failed to initialize process spawn helper after forking (child): " << DiagnosticInformation(ex);
517+
_exit(EXIT_FAILURE);
518+
}
519+
511520
_exit(RunWorker(configs, closeConsoleLog, stderrFile));
512521
} catch (...) {
513522
_exit(EXIT_FAILURE);

0 commit comments

Comments
 (0)