From 7a586e3e19d278a8b4420da298e0f6267a9e335c Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Thu, 11 Jun 2026 17:08:26 +0200 Subject: [PATCH 1/7] chore: add DD_TRACE_RETRY_INTERVAL configuration Signed-off-by: Alexandre Rulleau --- ext/configuration.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/configuration.h b/ext/configuration.h index d6402649dc..f3d1b811db 100644 --- a/ext/configuration.h +++ b/ext/configuration.h @@ -107,6 +107,7 @@ enum datadog_sidecar_connection_mode { CONFIG(BOOL, DD_INJECT_FORCE, "false", .ini_change = zai_config_system_ini_change) \ CONFIG(DOUBLE, DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS, "5.0", .ini_change = zai_config_system_ini_change) \ CONFIG(BOOL, DD_REMOTE_CONFIG_ENABLED, "true", .ini_change = zai_config_system_ini_change) \ + CONFIG(INT, DD_TRACE_RETRY_INTERVAL, "100", .ini_change = zai_config_system_ini_change) \ CONFIG(BOOL, DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "true") #define DD_CONFIGURATIONS_ONLY From 8485862caaa36c43f562f5edf3ecbff3a1ecedb3 Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Thu, 11 Jun 2026 17:08:55 +0200 Subject: [PATCH 2/7] chore: bump libdatadog Signed-off-by: Alexandre Rulleau --- libdatadog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdatadog b/libdatadog index 382a08732c..92c0740f80 160000 --- a/libdatadog +++ b/libdatadog @@ -1 +1 @@ -Subproject commit 382a08732c4f0061c55f890830b5206afc3e929f +Subproject commit 92c0740f80f6464aad1ad9b142d0897a931542da From b25f3440b0bec122c867f6fae96911dee714be3b Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Thu, 11 Jun 2026 18:03:32 +0200 Subject: [PATCH 3/7] chore: bump libdatadog Signed-off-by: Alexandre Rulleau --- Cargo.lock | 3 +++ components-rs/crashtracker.h | 19 +++++++++++++++++++ components-rs/sidecar.h | 1 + libdatadog | 2 +- 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 4a77d2243d..081cd633ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1447,6 +1447,7 @@ dependencies = [ "libc 0.2.177", "libdd-common", "libdd-common-ffi", + "libdd-crashtracker", "libdd-crashtracker-ffi", "libdd-dogstatsd-client", "libdd-remote-config", @@ -3058,6 +3059,7 @@ dependencies = [ "base64 0.22.1", "futures", "futures-util", + "hashbrown 0.15.2", "http", "http-body-util", "hyper", @@ -3253,6 +3255,7 @@ dependencies = [ "rmp", "rmp-serde", "rmpv", + "rustc-hash 2.1.2", "serde", "serde_json", "tempfile", diff --git a/components-rs/crashtracker.h b/components-rs/crashtracker.h index 65ab3af974..5d366a1ce1 100644 --- a/components-rs/crashtracker.h +++ b/components-rs/crashtracker.h @@ -170,6 +170,25 @@ struct ddog_VoidResult ddog_crasht_report_unhandled_exception(ddog_CharSlice err ddog_CharSlice error_message, struct ddog_crasht_Handle_StackTrace *runtime_stack); +/** + * Register the expected PID of the socket-based crash receiver + * + * When `collect_all_threads` is enabled and the receiver is reached via a Unix + * socket, the crash handler will only grant ptrace permission if the socket + * peer's PID matches this registered value. + * + * Call this after establishing a trusted connection to the sidecar + * + * # Safety + * This function is safe to call from any thread at any time. + */ +void ddog_crasht_set_expected_receiver_pid(int32_t pid); + +/** + * Returns the currently registered expected receiver PID, or 0 if unset. + */ +int32_t ddog_crasht_get_expected_receiver_pid(void); + /** * Removes all existing additional tags * Expected to be used after a fork, to reset the additional tags on the child diff --git a/components-rs/sidecar.h b/components-rs/sidecar.h index eb0b5be058..27edede5e9 100644 --- a/components-rs/sidecar.h +++ b/components-rs/sidecar.h @@ -200,6 +200,7 @@ ddog_MaybeError ddog_sidecar_session_set_config(struct ddog_SidecarTransport **t ddog_CharSlice language_version, ddog_CharSlice tracer_version, uint32_t flush_interval_milliseconds, + uint32_t retry_interval_milliseconds, uint32_t remote_config_poll_interval_millis, uint32_t telemetry_heartbeat_interval_millis, uint64_t telemetry_extended_heartbeat_interval_millis, diff --git a/libdatadog b/libdatadog index 92c0740f80..e9f8b55afc 160000 --- a/libdatadog +++ b/libdatadog @@ -1 +1 @@ -Subproject commit 92c0740f80f6464aad1ad9b142d0897a931542da +Subproject commit e9f8b55afc5e2e7b56264b601bd6d81c69ccdc30 From 8cebf0800440f9002cf8d863938e46cce9f86650 Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Thu, 11 Jun 2026 18:11:27 +0200 Subject: [PATCH 4/7] chore: add retry interval to session config Signed-off-by: Alexandre Rulleau --- ext/sidecar.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/sidecar.c b/ext/sidecar.c index 74a1e58884..5d1348840c 100644 --- a/ext/sidecar.c +++ b/ext/sidecar.c @@ -110,6 +110,7 @@ static void dd_sidecar_post_connect(ddog_SidecarTransport **transport, bool is_f php_version_rt, DDOG_CHARSLICE_C(PHP_DDTRACE_VERSION), get_global_DD_TRACE_AGENT_FLUSH_INTERVAL(), + get_global_DD_TRACE_RETRY_INTERVAL(), (int)(get_global_DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS() * 1000), // for historical reasons in seconds get_global_DD_TELEMETRY_HEARTBEAT_INTERVAL() * 1000, From 2634ce01bd5eadda3b6138f16cc8e91646913aa4 Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Thu, 11 Jun 2026 18:20:14 +0200 Subject: [PATCH 5/7] chore: bump configuration Signed-off-by: Alexandre Rulleau --- metadata/supported-configurations.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/metadata/supported-configurations.json b/metadata/supported-configurations.json index f5f379f098..1cf6ad217f 100644 --- a/metadata/supported-configurations.json +++ b/metadata/supported-configurations.json @@ -2168,6 +2168,13 @@ "default": "false" } ], + "DD_TRACE_RETRY_INTERVAL": [ + { + "implementation": "B", + "type": "int", + "default": "100" + } + ], "DD_TRACE_ROADRUNNER_ANALYTICS_ENABLED": [ { "implementation": "A", From 97e8580767dc8dff952380513496fcfeb4c2e1c7 Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Fri, 12 Jun 2026 13:11:11 +0200 Subject: [PATCH 6/7] test(ci): set DD_TRACE_RETRY_INTERVAL=1 for extension tests Run the .phpt suite with a 1ms sidecar trace-send retry interval so doomed sends to unreachable agent endpoints (the bulk of the suite defaults to localhost:8126 with no listener) clear their retries near-instantly instead of clogging the shared sidecar flusher under -j4, which caused the flaky client_side_stats Kind(TimedOut) / wait-for-replay-timeout failures. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6a62a69081..fb02702cc0 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ TRACER_SOURCES_INI := -d datadog.trace.sources_path=$(TRACER_SOURCE_DIR) RUN_TESTS_IS_PARALLEL ?= $(shell test $(PHP_MAJOR_MINOR) -ge 74 && echo 1) # shuffle parallel tests to evenly distribute test load, avoiding a batch of 32 tests being request-replayer tests -RUN_TESTS_CMD := DD_SERVICE= DD_ENV= REPORT_EXIT_STATUS=1 TEST_PHP_SRCDIR=$(PROJECT_ROOT) USE_TRACKED_ALLOC=1 php -n -d 'memory_limit=-1' $(BUILD_DIR)/run-tests.php $(if $(QUIET_TESTS),,-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP) $(if $(ASAN), --asan) --show-diff -n -p $(shell which php) -q $(if $(RUN_TESTS_IS_PARALLEL), --shuffle -j$(MAX_TEST_PARALLELISM)) +RUN_TESTS_CMD := DD_SERVICE= DD_ENV= DD_TRACE_RETRY_INTERVAL=1 REPORT_EXIT_STATUS=1 TEST_PHP_SRCDIR=$(PROJECT_ROOT) USE_TRACKED_ALLOC=1 php -n -d 'memory_limit=-1' $(BUILD_DIR)/run-tests.php $(if $(QUIET_TESTS),,-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP) $(if $(ASAN), --asan) --show-diff -n -p $(shell which php) -q $(if $(RUN_TESTS_IS_PARALLEL), --shuffle -j$(MAX_TEST_PARALLELISM)) C_FILES = $(shell find components components-rs ext src/dogstatsd tracer zend_abstract_interface -name '*.c' -o -name '*.h' | awk '{ printf "$(BUILD_DIR)/%s\n", $$1 }' ) TEST_FILES = $(shell find tests/ext -name '*.php*' -o -name '*.inc' -o -name '*.json' -o -name '*.yaml' -o -name 'CONFLICTS' | awk '{ printf "$(BUILD_DIR)/%s\n", $$1 }' ) From 1de4e302815f53c1dc8ad4a3860c1177233c9399 Mon Sep 17 00:00:00 2001 From: Alexandre Rulleau Date: Fri, 12 Jun 2026 14:11:11 +0200 Subject: [PATCH 7/7] test(telemetry): expect DD_TRACE_RETRY_INTERVAL in config telemetry Setting DD_TRACE_RETRY_INTERVAL=1 in RUN_TESTS_CMD makes it a non-default env-var config, so it now appears (origin=env_var) in config.phpt's reported configuration list. Add the entry and renumber the subsequent indices. --- tests/ext/telemetry/config.phpt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ext/telemetry/config.phpt b/tests/ext/telemetry/config.phpt index d4f950aff4..fdebcc03fb 100644 --- a/tests/ext/telemetry/config.phpt +++ b/tests/ext/telemetry/config.phpt @@ -19,6 +19,7 @@ DD_TRACE_AUTOFINISH_SPANS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_AGENT_HOST= DD_AUTOLOAD_NO_COMPILE= +DD_TRACE_RETRY_INTERVAL= DD_TRACE_GIT_METADATA_ENABLED=0 DD_TRACE_IGNORE_AGENT_SAMPLING_RATES=1 DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED=0