fix(libdd-common): crashes caused by getenv while retrieving AAS env vars#1930
Conversation
getenv while retrieving AAS env varsgetenv while retrieving AAS env vars
getenv while retrieving AAS env varsgetenv while retrieving AAS env vars
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6dfe7318d7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review (asking for a Codex review because I'm not exactly a Rust expert) |
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis 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. |
KowalskiThomas
left a comment
There was a problem hiding this comment.
Overall this makes sense to me, but I'll wait for the Codex review to approve.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6dfe7318d7
ℹ️ 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".
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 8118cf6 | Docs | Datadog PR Page | Give us feedback! |
KowalskiThomas
left a comment
There was a problem hiding this comment.
Appreciate the change 🙇
Take the review with a grain of salt as I said I'm really not an expert here...
|
|
||
| env::set_var("TEST_VAR_EMPTY_STRING", ""); | ||
| assert_eq!(get_trimmed_env_var!("TEST_VAR_EMPTY_STRING"), None); | ||
| fn test_get_trimmed_env_var_missing() { |
There was a problem hiding this comment.
I think you could test read_proc_self_environ by comparing it to the current environment (obtained from the Rust stdlib), but this has a risk of flakiness, since for any reason if something else grew the environment in between, they might disagree. Thought maybe that has no risk of happening in the test binary? I don't know, I'll let you decide 😛
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1930 +/- ##
==========================================
+ Coverage 71.77% 71.78% +0.01%
==========================================
Files 434 434
Lines 69978 69999 +21
==========================================
+ Hits 50227 50252 +25
+ Misses 19751 19747 -4
🚀 New features to boost your workflow:
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
Co-authored-by: Thomas Kowalski <thomas.kowalski@datadoghq.com>
5211007 to
8118cf6
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
# Release proposal for libdd-telemetry and its dependencies This PR contains version bumps based on public API changes and commits since last release. ## libdd-capabilities **Next version:** `2.0.0` **Semver bump:** `major` **Tag:** `libdd-capabilities-v2.0.0` ### Commits - feat(capablities)!: sleep & spawn capabilities (#1873) ## libdd-common **Next version:** `4.1.0` **Semver bump:** `minor` **Tag:** `libdd-common-v4.1.0` ### Commits - refactor(sampling): move the sampling logic from dd-trace-rs [APMSP-2946] (#1927) - feat!: added regex-lite feature (#1939) - fix(libdd-common): crashes caused by `getenv` while retrieving AAS env vars (#1930) ## libdd-capabilities-impl **Next version:** `2.0.0` **Semver bump:** `major` **Tag:** `libdd-capabilities-impl-v2.0.0` ### Commits - feat(capablities)!: sleep & spawn capabilities (#1873) ## libdd-shared-runtime **Next version:** `1.0.0` **Semver bump:** `major` **Tag:** `libdd-shared-runtime-v1.0.0` **Warning:** this is an initial release. Please verify that the version and commits included are correct. ## libdd-telemetry **Next version:** `5.0.0` **Semver bump:** `major` **Tag:** `libdd-telemetry-v5.0.0` ###⚠️ major bump forced due to: - `libdd-common`: ^3.0.2 → ^4.0.0 ### Commits - fix(libdd-telemetry): restore previous Cargo.toml version (#1993) - feat(capablities)!: sleep & spawn capabilities (#1873) - fix(telemetry): avoid trigger loop in telemetry worker (#1950) - feat(telemetry)!: include dependencies and integrations in app-extended-heartbeat (#1962) - fix(crypto): gate libdd-common TLS features in remaining internal crates + add CI guard (#1943) - fix(telemetry): schedule ExtendedHeartbeat on worker start (#1910) - fix(telemetry): skip sending empty payloads (#1894) - feat(sidecar): wire telemetry_extended_heartbeat_interval through SessionConfig (#1882) - chore(telemetry): add session id support (#1817) - ci(libdd-shared-runtime): downgrade version so publish workflow succeeds (#1870) - feat(runtime)!: add shared runtime (#1602) - perf(sidecar)!: Batch ack sending & consumption (#1835) - fix(telemetry): wire up DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL to scheduler (#1824) - feat(capabilities)!: trait architecture http (#1555) - chore(telemetry): use weaker mem ordering for SEQ_ID (#1749) [APMSP-2946]: https://datadoghq.atlassian.net/browse/APMSP-2946?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: iunanua <18325288+iunanua@users.noreply.github.com>
What does this PR do?
This PR reads
/proc/self/environto populate AAS metadata (from env var) instead of usinggetenv.Motivation
getenvis not thread-safe. A call can crash if another thread is callingsetenv. This will invalidate theenvironpointers and cause a crash.