Skip to content

fix(prof): early init default connector to fix env var race#3432

Merged
realFlowControl merged 1 commit into
masterfrom
florian/fix-env-crash
Sep 24, 2025
Merged

fix(prof): early init default connector to fix env var race#3432
realFlowControl merged 1 commit into
masterfrom
florian/fix-env-crash

Conversation

@realFlowControl

@realFlowControl realFlowControl commented Sep 23, 2025

Copy link
Copy Markdown
Member

Description

This pr make sure we initialize ddcommon::connector::Connector::default(); in MINIT already, so that rustls_native_certs::load_native_certs() calls env::var() for SSL_CERT_FILE and SSL_CERT_DIR while still single threaded. This fixes a very rare crash we have seen when the uploading thread is doing it's first upload while the main thread (or any other thread) manipulates the environment variables for this process.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

PROF-12605

@realFlowControl
realFlowControl marked this pull request as ready for review September 23, 2025 19:39
@realFlowControl
realFlowControl requested a review from a team as a code owner September 23, 2025 19:39
@github-actions github-actions Bot added profiling Relates to the Continuous Profiler tracing labels Sep 23, 2025
@codecov-commenter

codecov-commenter commented Sep 23, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.74%. Comparing base (c70ff24) to head (43cfc69).
⚠️ Report is 391 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3432      +/-   ##
==========================================
- Coverage   61.85%   61.74%   -0.12%     
==========================================
  Files         141      141              
  Lines       12481    12481              
  Branches     1630     1630              
==========================================
- Hits         7720     7706      -14     
- Misses       4041     4054      +13     
- Partials      720      721       +1     

see 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c70ff24...43cfc69. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter

pr-commenter Bot commented Sep 23, 2025

Copy link
Copy Markdown

Benchmarks [ profiler ]

Benchmark execution time: 2025-09-23 19:47:22

Comparing candidate commit 43cfc69 in PR branch florian/fix-env-crash with baseline commit c70ff24 in branch master.

Found 0 performance improvements and 9 performance regressions! Performance is the same for 19 metrics, 8 unstable metrics.

scenario:php-profiler-exceptions-control

  • 🟥 execution_time [+11.926ms; +13.163ms] or [+17.030%; +18.796%]
  • 🟥 max_rss_usage [+606.799KB; +1082.801KB] or [+2.147%; +3.831%]

scenario:php-profiler-exceptions-with-profiler

  • 🟥 cpu_user_time [+5.247ms; +11.233ms] or [+7.376%; +15.790%]
  • 🟥 execution_time [+10.940ms; +14.238ms] or [+12.446%; +16.198%]
  • 🟥 max_rss_usage [+0.991MB; +1.467MB] or [+3.431%; +5.080%]

scenario:php-profiler-exceptions-with-profiler-and-timeline

  • 🟥 execution_time [+11.597ms; +13.976ms] or [+13.221%; +15.932%]
  • 🟥 max_rss_usage [+0.939MB; +1.365MB] or [+3.252%; +4.727%]

scenario:php-profiler-timeline-memory-control

  • 🟥 max_rss_usage [+1.152MB; +1.152MB] or [+4.110%; +4.110%]

scenario:php-profiler-timeline-memory-with-profiler

  • 🟥 max_rss_usage [+606.799KB; +1082.801KB] or [+2.118%; +3.780%]

@realFlowControl
realFlowControl merged commit 5599a85 into master Sep 24, 2025
1867 of 1873 checks passed
@realFlowControl
realFlowControl deleted the florian/fix-env-crash branch September 24, 2025 16:17
@github-actions github-actions Bot added this to the 1.13.0 milestone Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants