Skip to content

feat(sidecar): add thread mode as fallback connection for restricted environments#1447

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 13 commits intomainfrom
leiyks/sidecar-threaded-fallback
Mar 19, 2026
Merged

feat(sidecar): add thread mode as fallback connection for restricted environments#1447
gh-worker-dd-mergequeue-cf854d[bot] merged 13 commits intomainfrom
leiyks/sidecar-threaded-fallback

Conversation

@Leiyks
Copy link
Contributor

@Leiyks Leiyks commented Jan 14, 2026

What does this PR do?

Implements a thread-based sidecar connection mode as an alternative to the existing subprocess mode. When enabled, the sidecar runs as a Tokio thread within the PHP process rather than as a separate subprocess.

Key implementation details:

  • New thread connection mode alongside existing subprocess mode
  • Uses an abstract Unix socket (Linux) or named pipe (Windows) for IPC between the PHP-FPM master thread listener and worker processes
  • The master UID is encoded in the socket/pipe name to support cross-user scenarios (e.g. FPM master as root, workers as www-data)
  • SHM open mode is configurable via a global hook (set_shm_open_mode) to support cross-user shared memory access via fchown/SO_PEERCRED
  • Orphan promotion: if the master's thread listener is unavailable, a worker can promote itself to master
  • Uses current_thread Tokio runtime to avoid spawning additional OS threads beyond the single listener thread
  • Windows support via named pipes (where subprocess mode had limitations)

How to test the change?

Tested via the dd-trace-php integration test suite:

  • SidecarThreadModeTest: verifies multi-request tracing works in thread mode
  • SidecarThreadModeRootTest: verifies cross-user SHM access when FPM master runs as root
  • .phpt unit tests for connection mode configuration and auto-fallback behavior

@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 5.44747% with 243 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.10%. Comparing base (c219ca2) to head (83a7602).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1447      +/-   ##
==========================================
- Coverage   71.48%   71.10%   -0.39%     
==========================================
  Files         430      431       +1     
  Lines       64079    64344     +265     
==========================================
- Hits        45810    45751      -59     
- Misses      18269    18593     +324     
Components Coverage Δ
libdd-crashtracker 63.80% <ø> (-0.15%) ⬇️
libdd-crashtracker-ffi 17.10% <ø> (-1.09%) ⬇️
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 87.50% <ø> (-0.43%) ⬇️
libdd-data-pipeline-ffi 73.92% <ø> (-0.94%) ⬇️
libdd-common 79.73% <ø> (ø)
libdd-common-ffi 73.40% <ø> (ø)
libdd-telemetry 62.48% <ø> (ø)
libdd-telemetry-ffi 16.75% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 80.29% <58.33%> (-0.07%) ⬇️
libdd-profiling 81.60% <ø> (+0.01%) ⬆️
libdd-profiling-ffi 63.65% <ø> (ø)
datadog-sidecar 31.18% <2.85%> (-1.93%) ⬇️
datdog-sidecar-ffi 6.83% <0.00%> (-3.96%) ⬇️
spawn-worker 54.69% <ø> (ø)
libdd-tinybytes 93.16% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 91.80% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 89.08% <ø> (+0.13%) ⬆️
datadog-tracer-flare 86.88% <ø> (-3.59%) ⬇️
libdd-log 74.69% <ø> (ø)
🚀 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.

@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch from df12cb3 to 917aceb Compare January 14, 2026 14:11
@pr-commenter
Copy link

pr-commenter bot commented Jan 14, 2026

Benchmarks

Comparison

Benchmark execution time: 2026-03-18 14:14:48

Comparing candidate commit 83a7602 in PR branch leiyks/sidecar-threaded-fallback with baseline commit c219ca2 in branch main.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 2 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:benching deserializing traces from msgpack to their internal representation

  • 🟩 execution_time [-2.643ms; -2.281ms] or [-5.310%; -4.581%]

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
concentrator/add_spans_to_concentrator execution_time 12.994ms 13.027ms ± 0.020ms 13.024ms ± 0.009ms 13.035ms 13.054ms 13.109ms 13.171ms 1.13% 2.967 16.325 0.15% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
concentrator/add_spans_to_concentrator execution_time [13.024ms; 13.029ms] or [-0.021%; +0.021%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
redis/obfuscate_redis_string execution_time 33.469µs 34.241µs ± 0.971µs 33.657µs ± 0.100µs 35.370µs 36.135µs 36.309µs 37.076µs 10.16% 1.033 -0.615 2.83% 0.069µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
redis/obfuscate_redis_string execution_time [34.106µs; 34.375µs] or [-0.393%; +0.393%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 3.894µs 3.913µs ± 0.003µs 3.912µs ± 0.001µs 3.914µs 3.917µs 3.919µs 3.921µs 0.21% -1.046 9.604 0.07% 0.000µs 1 200
credit_card/is_card_number/ throughput 255063855.775op/s 255582745.804op/s ± 180014.063op/s 255598402.510op/s ± 89886.659op/s 255687854.349op/s 255813860.387op/s 255910664.287op/s 256803096.828op/s 0.47% 1.068 9.757 0.07% 12728.916op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 80.252µs 80.758µs ± 0.214µs 80.731µs ± 0.138µs 80.878µs 81.153µs 81.316µs 81.480µs 0.93% 0.574 0.603 0.26% 0.015µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12272972.282op/s 12382793.303op/s ± 32734.528op/s 12386864.366op/s ± 21129.923op/s 12405841.307op/s 12428734.937op/s 12454900.283op/s 12460709.824op/s 0.60% -0.556 0.579 0.26% 2314.681op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 73.056µs 73.525µs ± 0.271µs 73.499µs ± 0.188µs 73.687µs 74.013µs 74.273µs 74.462µs 1.31% 0.776 0.582 0.37% 0.019µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13429622.409op/s 13600955.949op/s ± 49939.946op/s 13605547.662op/s ± 34768.940op/s 13639141.997op/s 13670617.489op/s 13681002.687op/s 13688164.096op/s 0.61% -0.754 0.529 0.37% 3531.287op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.894µs 3.915µs ± 0.003µs 3.916µs ± 0.002µs 3.917µs 3.920µs 3.923µs 3.925µs 0.23% -1.137 6.190 0.09% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254789133.582op/s 255416780.349op/s ± 220150.549op/s 255384187.593op/s ± 142894.394op/s 255547357.247op/s 255748357.251op/s 255888612.929op/s 256772835.604op/s 0.54% 1.155 6.299 0.09% 15566.995op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 70.027µs 70.552µs ± 0.232µs 70.520µs ± 0.152µs 70.700µs 70.963µs 71.148µs 71.460µs 1.33% 0.572 0.613 0.33% 0.016µs 1 200
credit_card/is_card_number/378282246310005 throughput 13993907.526op/s 14174161.285op/s ± 46576.103op/s 14180325.528op/s ± 30633.967op/s 14207298.645op/s 14245047.545op/s 14259805.549op/s 14280288.064op/s 0.70% -0.550 0.562 0.33% 3293.428op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 53.064µs 53.137µs ± 0.038µs 53.130µs ± 0.020µs 53.152µs 53.218µs 53.239µs 53.273µs 0.27% 0.945 0.590 0.07% 0.003µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 18771188.351op/s 18819246.303op/s ± 13609.625op/s 18821854.484op/s ± 7209.005op/s 18828086.595op/s 18836734.661op/s 18839379.982op/s 18845216.954op/s 0.12% -0.941 0.582 0.07% 962.346op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.429µs 6.439µs ± 0.005µs 6.438µs ± 0.003µs 6.441µs 6.449µs 6.455µs 6.457µs 0.30% 1.022 1.256 0.08% 0.000µs 1 200
credit_card/is_card_number/x371413321323331 throughput 154868119.276op/s 155304613.082op/s ± 123427.041op/s 155326840.479op/s ± 72519.595op/s 155382962.851op/s 155466454.828op/s 155491781.883op/s 155554222.265op/s 0.15% -1.017 1.242 0.08% 8727.610op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.901µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.918µs 3.920µs 3.927µs 0.36% 0.510 3.790 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254643279.734op/s 255545207.236op/s ± 185013.467op/s 255563633.301op/s ± 109770.533op/s 255668621.460op/s 255789715.396op/s 255862750.660op/s 256369878.746op/s 0.32% -0.498 3.780 0.07% 13082.428op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 64.884µs 65.128µs ± 0.113µs 65.115µs ± 0.065µs 65.180µs 65.320µs 65.477µs 65.713µs 0.92% 1.550 5.017 0.17% 0.008µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15217773.252op/s 15354420.002op/s ± 26625.392op/s 15357464.442op/s ± 15213.388op/s 15372360.112op/s 15385211.352op/s 15407734.922op/s 15412055.310op/s 0.36% -1.526 4.894 0.17% 1882.700op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 58.222µs 58.393µs ± 0.119µs 58.375µs ± 0.082µs 58.461µs 58.596µs 58.715µs 58.833µs 0.78% 0.945 0.848 0.20% 0.008µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16997224.808op/s 17125335.480op/s ± 34902.724op/s 17130652.558op/s ± 24081.246op/s 17154263.733op/s 17170739.686op/s 17174355.545op/s 17175605.488op/s 0.26% -0.933 0.813 0.20% 2467.995op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.894µs 3.914µs ± 0.003µs 3.913µs ± 0.002µs 3.916µs 3.920µs 3.922µs 3.924µs 0.27% -0.228 4.394 0.09% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254850967.521op/s 255511288.021op/s ± 222782.168op/s 255547255.055op/s ± 117234.096op/s 255651270.864op/s 255788176.970op/s 255825944.719op/s 256774950.820op/s 0.48% 0.245 4.476 0.09% 15753.078op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 55.136µs 55.488µs ± 0.194µs 55.455µs ± 0.106µs 55.579µs 55.827µs 56.029µs 56.485µs 1.86% 1.389 4.087 0.35% 0.014µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17703849.805op/s 18022237.277op/s ± 62842.977op/s 18032618.417op/s ± 34410.984op/s 18064056.147op/s 18109194.310op/s 18123112.061op/s 18137077.628op/s 0.58% -1.346 3.868 0.35% 4443.670op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 53.071µs 53.143µs ± 0.036µs 53.140µs ± 0.022µs 53.165µs 53.205µs 53.253µs 53.291µs 0.28% 0.726 1.147 0.07% 0.003µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 18764978.474op/s 18817015.812op/s ± 12907.276op/s 18818366.866op/s ± 7947.291op/s 18825786.397op/s 18835335.656op/s 18841909.808op/s 18842825.215op/s 0.13% -0.721 1.132 0.07% 912.682op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.429µs 6.441µs ± 0.006µs 6.440µs ± 0.004µs 6.444µs 6.450µs 6.458µs 6.467µs 0.41% 0.736 1.562 0.09% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 154633498.694op/s 155262322.119op/s ± 142727.464op/s 155267626.701op/s ± 101998.504op/s 155370732.527op/s 155460702.846op/s 155531168.620op/s 155547195.603op/s 0.18% -0.728 1.532 0.09% 10092.356op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.912µs; 3.913µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/ throughput [255557797.586op/s; 255607694.022op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [80.728µs; 80.787µs] or [-0.037%; +0.037%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12378256.613op/s; 12387329.994op/s] or [-0.037%; +0.037%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [73.488µs; 73.563µs] or [-0.051%; +0.051%] None None None
credit_card/is_card_number/ 378282246310005 throughput [13594034.753op/s; 13607877.145op/s] or [-0.051%; +0.051%] None None None
credit_card/is_card_number/37828224631 execution_time [3.915µs; 3.916µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number/37828224631 throughput [255386269.601op/s; 255447291.098op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number/378282246310005 execution_time [70.519µs; 70.584µs] or [-0.046%; +0.046%] None None None
credit_card/is_card_number/378282246310005 throughput [14167706.285op/s; 14180616.285op/s] or [-0.046%; +0.046%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [53.132µs; 53.142µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [18817360.140op/s; 18821132.466op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.438µs; 6.440µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/x371413321323331 throughput [155287507.281op/s; 155321718.883op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.913µs; 3.914µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ throughput [255519566.149op/s; 255570848.323op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.112µs; 65.144µs] or [-0.024%; +0.024%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15350729.978op/s; 15358110.025op/s] or [-0.024%; +0.024%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [58.377µs; 58.410µs] or [-0.028%; +0.028%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17120498.298op/s; 17130172.662op/s] or [-0.028%; +0.028%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.913µs; 3.914µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255480412.555op/s; 255542163.487op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [55.461µs; 55.515µs] or [-0.049%; +0.049%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18013527.845op/s; 18030946.709op/s] or [-0.048%; +0.048%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [53.138µs; 53.148µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [18815226.987op/s; 18818804.636op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.440µs; 6.442µs] or [-0.013%; +0.013%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [155242541.465op/s; 155282102.773op/s] or [-0.013%; +0.013%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample_frames_x1000 execution_time 4.173ms 4.178ms ± 0.003ms 4.177ms ± 0.002ms 4.179ms 4.182ms 4.185ms 4.205ms 0.66% 3.261 24.212 0.08% 0.000ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample_frames_x1000 execution_time [4.177ms; 4.178ms] or [-0.011%; +0.011%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sql/obfuscate_sql_string execution_time 84.069µs 84.341µs ± 0.178µs 84.312µs ± 0.060µs 84.391µs 84.499µs 84.654µs 86.189µs 2.23% 6.849 63.379 0.21% 0.013µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [84.317µs; 84.366µs] or [-0.029%; +0.029%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching string interning on wordpress profile execution_time 159.810µs 160.530µs ± 0.275µs 160.497µs ± 0.135µs 160.644µs 160.933µs 161.469µs 162.163µs 1.04% 1.695 7.648 0.17% 0.019µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching string interning on wordpress profile execution_time [160.492µs; 160.568µs] or [-0.024%; +0.024%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sdk_test_data/rules-based execution_time 144.475µs 146.427µs ± 1.733µs 146.247µs ± 0.623µs 146.748µs 148.324µs 153.789µs 161.239µs 10.25% 4.989 34.544 1.18% 0.123µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sdk_test_data/rules-based execution_time [146.187µs; 146.667µs] or [-0.164%; +0.164%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample2_frames_x1000 execution_time 734.197µs 735.384µs ± 0.621µs 735.340µs ± 0.450µs 735.791µs 736.427µs 736.840µs 737.533µs 0.30% 0.417 -0.141 0.08% 0.044µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample2_frames_x1000 execution_time [735.298µs; 735.470µs] or [-0.012%; +0.012%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_trace/test_trace execution_time 237.186ns 249.604ns ± 15.168ns 242.688ns ± 3.539ns 252.937ns 287.740ns 291.184ns 293.181ns 20.81% 1.605 1.317 6.06% 1.073ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_trace/test_trace execution_time [247.502ns; 251.707ns] or [-0.842%; +0.842%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching serializing traces from their internal representation to msgpack execution_time 13.806ms 13.856ms ± 0.028ms 13.851ms ± 0.013ms 13.865ms 13.902ms 13.972ms 14.012ms 1.16% 2.122 7.424 0.20% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching serializing traces from their internal representation to msgpack execution_time [13.852ms; 13.860ms] or [-0.028%; +0.028%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
write only interface execution_time 1.178µs 3.173µs ± 1.387µs 2.967µs ± 0.023µs 2.988µs 3.652µs 13.626µs 14.629µs 393.11% 7.343 55.191 43.60% 0.098µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [2.981µs; 3.366µs] or [-6.057%; +6.057%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time 185.803µs 186.234µs ± 0.206µs 186.209µs ± 0.151µs 186.390µs 186.566µs 186.731µs 186.820µs 0.33% 0.364 -0.476 0.11% 0.015µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 5352747.391op/s 5369592.877op/s ± 5927.541op/s 5370298.170op/s ± 4346.862op/s 5373958.128op/s 5378294.876op/s 5379587.254op/s 5382054.562op/s 0.22% -0.359 -0.481 0.11% 419.140op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 17.858µs 17.989µs ± 0.103µs 17.987µs ± 0.032µs 18.015µs 18.058µs 18.094µs 19.285µs 7.21% 10.038 124.390 0.57% 0.007µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 51853885.338op/s 55591024.889op/s ± 300993.133op/s 55594928.808op/s ± 98775.922op/s 55705833.888op/s 55845007.130op/s 55908678.084op/s 55996363.530op/s 0.72% -9.600 117.181 0.54% 21283.429op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.225µs 10.323µs ± 0.081µs 10.295µs ± 0.033µs 10.339µs 10.503µs 10.553µs 10.571µs 2.68% 1.309 0.800 0.78% 0.006µs 1 200
normalization/normalize_name/normalize_name/good throughput 94597887.314op/s 96878502.500op/s ± 753040.994op/s 97134960.220op/s ± 306850.848op/s 97372132.966op/s 97672660.341op/s 97752659.887op/s 97799293.622op/s 0.68% -1.284 0.731 0.78% 53248.039op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time [186.206µs; 186.263µs] or [-0.015%; +0.015%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [5368771.377op/s; 5370414.378op/s] or [-0.015%; +0.015%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [17.975µs; 18.003µs] or [-0.079%; +0.079%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [55549310.135op/s; 55632739.642op/s] or [-0.075%; +0.075%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.312µs; 10.334µs] or [-0.109%; +0.109%] None None None
normalization/normalize_name/normalize_name/good throughput [96774138.261op/s; 96982866.739op/s] or [-0.108%; +0.108%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
ip_address/quantize_peer_ip_address_benchmark execution_time 5.014µs 5.097µs ± 0.047µs 5.108µs ± 0.038µs 5.129µs 5.162µs 5.166µs 5.166µs 1.14% -0.287 -1.346 0.91% 0.003µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [5.091µs; 5.103µs] or [-0.127%; +0.127%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
receiver_entry_point/report/2598 execution_time 3.380ms 3.421ms ± 0.035ms 3.413ms ± 0.010ms 3.426ms 3.482ms 3.516ms 3.737ms 9.52% 4.445 32.445 1.02% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
receiver_entry_point/report/2598 execution_time [3.416ms; 3.426ms] or [-0.142%; +0.142%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 495.304µs 496.368µs ± 0.690µs 496.267µs ± 0.286µs 496.540µs 497.122µs 499.860µs 499.930µs 0.74% 3.023 12.215 0.14% 0.049µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 2000279.372op/s 2014637.600op/s ± 2787.041op/s 2015044.434op/s ± 1163.526op/s 2016234.270op/s 2017341.154op/s 2018240.847op/s 2018960.507op/s 0.19% -3.002 12.083 0.14% 197.074op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 369.780µs 370.423µs ± 0.261µs 370.410µs ± 0.172µs 370.581µs 370.897µs 371.022µs 371.270µs 0.23% 0.311 0.130 0.07% 0.018µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2693460.115op/s 2699616.795op/s ± 1903.824op/s 2699713.508op/s ± 1249.550op/s 2700952.479op/s 2702549.728op/s 2703534.065op/s 2704312.897op/s 0.17% -0.307 0.126 0.07% 134.621op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 168.727µs 169.079µs ± 0.170µs 169.074µs ± 0.084µs 169.158µs 169.331µs 169.618µs 170.148µs 0.64% 1.551 7.743 0.10% 0.012µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5877221.026op/s 5914401.320op/s ± 5929.649op/s 5914586.630op/s ± 2925.100op/s 5917487.314op/s 5923223.428op/s 5926065.155op/s 5926744.337op/s 0.21% -1.529 7.600 0.10% 419.289op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 36.890µs 37.063µs ± 0.072µs 37.066µs ± 0.055µs 37.121µs 37.166µs 37.192µs 37.230µs 0.44% -0.320 -0.617 0.19% 0.005µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26859717.806op/s 26981170.111op/s ± 52543.277op/s 26978898.159op/s ± 40042.586op/s 27015743.548op/s 27078075.928op/s 27097832.162op/s 27107366.435op/s 0.48% 0.327 -0.612 0.19% 3715.371op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 46.197µs 46.311µs ± 0.122µs 46.292µs ± 0.037µs 46.338µs 46.406µs 46.469µs 47.832µs 3.33% 9.742 118.368 0.26% 0.009µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20906407.884op/s 21593134.545op/s ± 55560.451op/s 21602122.640op/s ± 17426.972op/s 21615681.085op/s 21634060.714op/s 21640140.853op/s 21646569.408op/s 0.21% -9.542 115.011 0.26% 3928.717op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time [496.273µs; 496.464µs] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [2014251.343op/s; 2015023.857op/s] or [-0.019%; +0.019%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [370.387µs; 370.459µs] or [-0.010%; +0.010%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2699352.944op/s; 2699880.647op/s] or [-0.010%; +0.010%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [169.055µs; 169.103µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5913579.528op/s; 5915223.113op/s] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.053µs; 37.073µs] or [-0.027%; +0.027%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26973888.119op/s; 26988452.104op/s] or [-0.027%; +0.027%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [46.294µs; 46.328µs] or [-0.037%; +0.037%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21585434.401op/s; 21600834.689op/s] or [-0.036%; +0.036%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching deserializing traces from msgpack to their internal representation execution_time 46.913ms 47.325ms ± 1.038ms 47.168ms ± 0.063ms 47.216ms 47.404ms 51.297ms 57.780ms 22.50% 7.661 64.728 2.19% 0.073ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching deserializing traces from msgpack to their internal representation execution_time [47.181ms; 47.469ms] or [-0.304%; +0.304%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
tags/replace_trace_tags execution_time 2.408µs 2.433µs ± 0.011µs 2.432µs ± 0.006µs 2.438µs 2.456µs 2.465µs 2.467µs 1.44% 0.648 0.806 0.46% 0.001µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
tags/replace_trace_tags execution_time [2.432µs; 2.435µs] or [-0.063%; +0.063%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
two way interface execution_time 18.025µs 25.454µs ± 9.213µs 18.309µs ± 0.241µs 33.334µs 42.386µs 49.950µs 67.187µs 266.97% 1.064 1.190 36.10% 0.651µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [24.177µs; 26.731µs] or [-5.016%; +5.016%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample_timestamped_x1000 execution_time 4.209ms 4.215ms ± 0.008ms 4.214ms ± 0.001ms 4.216ms 4.218ms 4.230ms 4.318ms 2.46% 10.897 136.388 0.19% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample_timestamped_x1000 execution_time [4.214ms; 4.216ms] or [-0.026%; +0.026%] None None None

Group 20

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 83a7602 1773842237 leiyks/sidecar-threaded-fallback
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
single_flag_killswitch/rules-based execution_time 190.816ns 193.415ns ± 2.127ns 193.051ns ± 1.333ns 194.479ns 197.182ns 198.945ns 205.328ns 6.36% 1.574 4.821 1.10% 0.150ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
single_flag_killswitch/rules-based execution_time [193.120ns; 193.710ns] or [-0.152%; +0.152%] None None None

Baseline

Omitted due to size.

@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch from 917aceb to d87edf1 Compare January 15, 2026 12:56
@dd-octo-sts
Copy link
Contributor

dd-octo-sts bot commented Jan 15, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.70 MB 8.70 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 100.36 MB 100.36 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.28 MB 11.28 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 117.03 MB 117.03 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 27.18 MB 27.18 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 76.61 KB 76.61 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 186.12 MB 186.12 MB +0% (+8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 917.07 MB 917.07 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.94 MB 9.94 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 76.61 KB 76.61 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 24.78 MB 24.78 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.46 MB 51.46 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 22.98 MB 22.98 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 77.80 KB 77.80 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 190.30 MB 190.33 MB +.01% (+24.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 900.75 MB 900.75 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 7.54 MB 7.54 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 77.80 KB 77.80 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 26.52 MB 26.52 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 47.09 MB 47.09 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 87.57 MB 87.57 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 10.22 MB 10.22 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 109.90 MB 109.90 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.97 MB 11.97 MB 0% (0 B) 👌

@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch from d87edf1 to 34adc5d Compare January 15, 2026 13:47
@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch 6 times, most recently from 31a48ff to 801ac3e Compare January 26, 2026 12:35
@Leiyks Leiyks marked this pull request as ready for review January 26, 2026 12:36
@Leiyks Leiyks requested review from a team as code owners January 26, 2026 12:36
@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch from 801ac3e to b7d89dd Compare January 26, 2026 16:02
@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch from b7d89dd to cc2fb3d Compare February 18, 2026 13:25
@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/leiyks/sidecar-threaded-fallback

Summary by Rule

Rule Base Branch PR Branch Change
panic 1 1 No change (0%)
unwrap_used 11 11 No change (0%)
Total 12 12 No change (0%)

Annotation Counts by File

File Base Branch PR Branch Change
datadog-ipc/src/platform/unix/mem_handle.rs 2 2 No change (0%)
datadog-ipc/src/platform/unix/mem_handle_macos.rs 6 6 No change (0%)
datadog-sidecar/src/unix.rs 4 4 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 28 28 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 59 59 No change (0%)
libdd-common 10 10 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 19 19 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 9 9 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 208 208 No change (0%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch from cc2fb3d to 8beb392 Compare March 2, 2026 14:38
@bwoebi
Copy link
Contributor

bwoebi commented Mar 3, 2026

So, on Linux connect_to_master() does not use the pid for connections to master. (= it connects to a "random" (first to spawn) PHP process.)
On windows it does.

However the primary_sidecar_identifier is unchanged - it would need to incorporate the pid instead of the euid (linux)/user terminal id (windows) in threaded mode. Otherwise multiple processes are going to interfere and use the same resources.

@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch 3 times, most recently from d148ca6 to 69a98fb Compare March 6, 2026 14:02
@Leiyks Leiyks requested a review from bwoebi March 10, 2026 12:10
@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch from a66093e to e93220a Compare March 11, 2026 16:23
@Leiyks Leiyks changed the title feat(sidecar): implement thread listener module feat(sidecar): add thread mode as fallback connection for restricted environments Mar 12, 2026
Copy link
Contributor

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

This looks good now. I'll refactor some parts of it in #1742 (like the getting of the peercred, or the process handle story - which conflicts with this PR).

Leiyks added 13 commits March 18, 2026 14:57
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
…interference

In thread mode on Linux, primary_sidecar_identifier() returned geteuid(),
causing all PHP processes with the same euid to share the same Unix socket
and sidecar resources (SHM, rate limiters, crash tracker, etc.).

- Add set_sidecar_master_pid(pid) and update primary_sidecar_identifier()
  to return the stored PID instead of euid when in thread mode
- Add SharedDirLiaison::ipc_for_pid(pid) to build per-master socket paths
- Use ipc_for_pid(pid) in both run_listener and connect_to_master so the
  socket path is always pid-specific, matching Windows named-pipe behavior
- Call set_sidecar_master_pid from ddog_sidecar_connect_master so all shared
  resources use the master PID as their identifier key
… compatibility

Thread-mode sockets are placed in /tmp/libdatadog/ with the master's effective
uid encoded in the socket name (libdd.<ver>@<uid>-<pid>.sock). This ensures that
a worker process that has since dropped privileges via setuid() (e.g. www-data
under PHP-FPM) still computes the same socket path as the master listener.

Also fix ensure_dir_exists to always attempt chmod 0o777 (best-effort, ignoring
EPERM) so that even pre-existing directories get the world-writable bit set when
the process has sufficient permissions.

Also fix socket/lock path construction: remove spurious .with_extension(".sock")
(which produced a double-dot suffix on Rust >=1.87) and use "sock.lock" without
a leading dot for the lock file.
…untime

- Switch thread mode IPC to AbstractUnixSocketLiaison on Linux: abstract
  sockets have no filesystem permissions, so PHP-FPM workers running as
  a different user (e.g. www-data) can connect to a sidecar thread running
  in the master process without any chmod/chown workarounds
- Use new_current_thread() Tokio runtime in run_listener to avoid spawning
  extra OS worker threads that trigger LSan "Running thread was not
  suspended" warnings at process exit under ASAN
- Move UnixListener::from_std() inside block_on so it runs with an active
  Tokio reactor (required by the tokio::net API)
- Remove unused SIDECAR_MASTER_UID tracking (replaced by abstract sockets)
- Keep SharedDirLiaison::attempt_listen chmod 0o777 for non-Linux platforms
In thread mode under PHP-FPM, the sidecar runs as a thread inside the
master process (possibly root). Named SHM objects (/ddlimiters-*, /ddrc*,
/ddcfg*) were created with 0600 (owner-only), preventing PHP worker
processes running as a different user (e.g. www-data) from opening them.

Add a global SHM_OPEN_MODE atomic in datadog-ipc that defaults to 0600.
NamedShmHandle::create() now reads this global instead of hardcoding the
mode. Expose ddog_sidecar_set_shm_open_mode() via FFI so the PHP
extension can set 0644 before starting the sidecar master listener when
running as root.
In PHP-FPM thread mode the master process runs as root and spawns worker
processes as www-data. Named POSIX SHM objects were created with 0600
(owner-only), so workers could not open them for writing.

The correct fix is to fchown() the SHM to the worker's UID after creation.
The worker UID is obtained via SO_PEERCRED (peer_cred()) on the first
accepted Unix socket connection in the thread listener, before the SHM
lazy-lock is initialized.

Changes:
- Replace set_shm_open_mode/SHM_OPEN_MODE with set_shm_owner_uid/SHM_OWNER_UID
  in both mem_handle.rs and mem_handle_macos.rs
- Call fchown(fd, worker_uid, None) in NamedShmHandle::create_mode() when
  SHM_OWNER_UID is set; restore default mode to S_IWUSR|S_IRUSR (0600)
- Add nix "user" feature to datadog-ipc for fchown/Uid support
- Add init_shm_eagerly field to MainLoopConfig (default true); thread mode
  sets it false to defer SHM initialization to first connection
- In accept_socket_loop_thread: use FIRST_CONNECTION_INIT OnceLock to call
  set_shm_owner_uid(peer_uid) then init SHM_LIMITER exactly once on first
  worker connection
- Remove ddog_sidecar_set_shm_open_mode FFI function (no longer needed)
@Leiyks Leiyks force-pushed the leiyks/sidecar-threaded-fallback branch from e93220a to 83a7602 Compare March 18, 2026 13:57
@bwoebi
Copy link
Contributor

bwoebi commented Mar 19, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link

gh-worker-devflow-routing-ef8351 bot commented Mar 19, 2026

View all feedbacks in Devflow UI.

2026-03-19 19:00:40 UTC ℹ️ Start processing command /merge


2026-03-19 19:00:44 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 45m (p90).


2026-03-19 19:41:43 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot merged commit c6ef98e into main Mar 19, 2026
86 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot deleted the leiyks/sidecar-threaded-fallback branch March 19, 2026 19:41
bwoebi added a commit that referenced this pull request Mar 20, 2026
…-unprocessed

* 'main' of github.com:DataDog/libdatadog:
  feat(sidecar): add thread mode as fallback connection for restricted environments (#1447)
  feat(profiling-ffi): ProfilesDictionary_insert_strs (#1764)
  chore(release): merge release branch to main (#1760)
  fix(libdd-crashtracker-ffi)!: add missing fields for endpoint configuration (#1758)
  ci: prevent running macos tests on release branches (#1765)
  chore(datadog-tracer-flare): remove unnecessary features/deps (#1761)
  fix(profiling-ffi): Windows extern statics need __declspec(dllimport) (#1468)
  feat(profiling): thread id/name as well-known strs (#1757)
  ci: switch to ephemeral branches (#1731)
  chore(crashtracker): use weaker mem ordering for OP_COUNTERS (#1744)
  refactor(trace-utils)!: change header name type to accept dynamic values (#1722)
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