Skip to content

Split rinit ordering in "before sidecar init" and "after sidecar init"#3946

Merged
bwoebi merged 1 commit into
masterfrom
bob/fix-rinit-ordering
Jun 3, 2026
Merged

Split rinit ordering in "before sidecar init" and "after sidecar init"#3946
bwoebi merged 1 commit into
masterfrom
bob/fix-rinit-ordering

Conversation

@bwoebi

@bwoebi bwoebi commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Fix up after splitting, otherwise e.g. debugger structures aren't initialized yet when sidecar is initialized.

This broke in multi-request scenarios.

Fix up after splitting, otherwise e.g. debugger structures aren't initialized yet when sidecar is initialized.

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi requested a review from a team as a code owner June 3, 2026 12:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48899dc444

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ext/datadog.c
datadog_apply_agent_info();

#ifdef DDTRACE
ddtrace_rinit_early();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep trace initialization after remote config processing

When remote config changes datadog.trace.enabled during datadog_sidecar_rinit() (it processes RC in ext/sidecar.c:759), this earlier call has already created DDTRACE_G(active_stack). That makes datadog_alter_dd_trace_disabled_config() treat the request as initialized: disabling tracing calls dd_clean_globals() before dd_initialize_request() has initialized those globals, and enabling tracing can call dd_initialize_request() here and then again in the later ddtrace_rinit(). In multi-request sidecar/RC setups this can corrupt request state or crash at RINIT.

Useful? React with 👍 / 👎.

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jun 3, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 66 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | ASAN test_c with multiple observers: [8.4]   View in Datadog   GitLab

See error Fatal error: Uncaught Exception: wait for replay timeout at /go/src/github.com/DataDog/apm-reliability/dd-trace-php/tmp/build_extension/tests/ext/includes/request_replayer.inc:100

DataDog/apm-reliability/dd-trace-php | ASAN test_c with multiple observers: [8.5]   View in Datadog   GitLab

See error Client-side SHM span stats could not be flushed due to timeout.

DataDog/apm-reliability/dd-trace-php | ASAN test_c: [8.3, amd64]   View in Datadog   GitLab

See error 1 failed test. Error: The sidecar trace flusher sender informs about changes to the agent sample rate in agent_sampling_sidecar.phpt.

View all 66 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 24 jobs - 24 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.12% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 48899dc | Docs | Datadog PR Page | Give us feedback!

@bwoebi bwoebi merged commit 2ef15a9 into master Jun 3, 2026
2068 of 2134 checks passed
@bwoebi bwoebi deleted the bob/fix-rinit-ordering branch June 3, 2026 14:16
@github-actions github-actions Bot added this to the 1.21.0 milestone Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants