You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: prod/native/extension/code/ForkHandler.cpp
+17-24Lines changed: 17 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -7,42 +7,34 @@
7
7
#include"os/OsUtils.h"
8
8
#include"LoggerInterface.h"
9
9
#include"ModuleGlobals.h"
10
-
#include"PeriodicTaskExecutor.h"
11
-
#include"transport/HttpTransportAsync.h"
10
+
#include"ForkableRegistry.h"
12
11
13
-
staticvoidcallbackToLogForkBeforeInParent() {
12
+
namespaceopentelemetry::php {
13
+
14
+
staticvoidbeforeFork() {
14
15
ELOGF_NF_DEBUG(OTEL_GL(logger_), "Before process fork (i.e., in parent context); its parent (i.e., grandparent) PID: %d", static_cast<int>(opentelemetry::osutils::getParentProcessId()));
15
16
// TODO implement forkable registry
16
-
if (OTEL_G(globals) && OTEL_G(globals)->periodicTaskExecutor_) {
Copy file name to clipboardExpand all lines: prod/native/extension/code/ModuleInit.cpp
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -94,6 +94,9 @@ void moduleInit(int moduleType, int moduleNumber) {
94
94
if (php_check_open_basedir_ex(OTEL_GL(config_)->get(&opentelemetry::php::ConfigurationSnapshot::bootstrap_php_part_file).c_str(), false) != 0) {
95
95
ELOGF_WARNING(globals->logger_, MODULE, "OpenTelemetry PHP distro bootstrap file (%s) is located outside of paths allowed by open_basedir ini setting.", OTEL_GL(config_)->get(&opentelemetry::php::ConfigurationSnapshot::bootstrap_php_part_file).c_str());
96
96
}
97
+
98
+
// Registering fork handlers in module init to ensure that we will handle all forks properly - even those triggered before request start (e.g. in MINIT of other extensions) or when fpm/apache spawns worker processes. We cannot be sure that some of the classes implementing ForkableInterface will not start thread before request start.
99
+
registerCallbacksToHandleFork();
97
100
}
98
101
99
102
voidmoduleShutdown( int moduleType, int moduleNumber ) {
0 commit comments