fix(sidecar/telemetry): retry FFI telemetry batches when session conifg not yet available#1929
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1873fcefb9
ℹ️ 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".
bwoebi
left a comment
There was a problem hiding this comment.
I suppose that's a good stop-gap until we unify communication over the sidecar socket.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1929 +/- ##
==========================================
- Coverage 71.80% 71.65% -0.16%
==========================================
Files 434 434
Lines 69978 70091 +113
==========================================
- Hits 50248 50222 -26
- Misses 19730 19869 +139
🚀 New features to boost your workflow:
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 44e71ac | Docs | Datadog PR Page | Give us feedback! |
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
|
811fb16 to
c933868
Compare
…ig not yet available
When the appsec helper posts telemetry via the in-process FFI path
before the PHP IPC set_session_config message is processed, the
telemetry client cache would be poisoned with a Config { endpoint: None
} worker. All subsequent IPC enqueue_actions calls (including
AddEndpoint) would reuse this bad client and never send HTTP requests to
the agent, causing the Laravel8xTests "Endpoints are sent" test to time
out.
Fix: when get_telemetry_client finds session_config is None, return None
instead of calling get_or_create with Config::default(). The receiver
task retries the batch up to 3 times with a 1.5 s delay before dropping.
In the normal case set_session_config arrives within milliseconds so the
first retry succeeds and no telemetry is lost.
2eece2d to
44e71ac
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
8165d17
into
main
What does this PR do?
When the appsec helper posts telemetry via the in-process FFI path before the PHP IPC set_session_config message is processed, the telemetry client cache would be poisoned with a Config { endpoint: None } worker. All subsequent IPC enqueue_actions calls (including AddEndpoint) would reuse this bad client and never send HTTP requests to the agent, causing the Laravel8xTests "Endpoints are sent" test to time out.
Fix: when get_telemetry_client finds session_config is None, return None instead of calling get_or_create with Config::default(). The receiver task retries the batch up to 3 times with a 1.5 s delay before dropping. In the normal case set_session_config arrives within milliseconds so the first retry succeeds and no telemetry is lost.
How to test the change?
Tested via
./gradlew test7.4-debug --tests "com.datadog.appsec.php.integration.Laravel8xTests.Endpoints are sent" -PuseHelperRust. The error reproduced reliably on my machine after at most 3 or 4 retries.