Split rinit ordering in "before sidecar init" and "after sidecar init"#3946
Conversation
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>
There was a problem hiding this comment.
💡 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".
| datadog_apply_agent_info(); | ||
|
|
||
| #ifdef DDTRACE | ||
| ddtrace_rinit_early(); |
There was a problem hiding this comment.
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 👍 / 👎.
|
Fix up after splitting, otherwise e.g. debugger structures aren't initialized yet when sidecar is initialized.
This broke in multi-request scenarios.