Prevent OkHttp TaskRunner from retaining request contexts - #12468
Prevent OkHttp TaskRunner from retaining request contexts#12468amarziali wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
The OkHttp TaskRunner exclusion has a narrow scope. It blocks generic Runnable context capture for TaskRunner nested classes and does not change other exclusion types.
🤖 Datadog Autotest · Commit 6922111 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 69221116cf
ℹ️ 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".
|
🎯 Code Coverage (details) 🔗 Commit SHA: 6922111 | Docs | View more details | Give us feedback! |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
What does this PR do?
Excludes OkHttp's internal
TaskRunnerworker loop from genericRunnablecontext propagation.TaskRunner$runnable$1is a long-lived scheduler loop, not a single request task. Capturing the submitting request context on it keeps that trace open until the runner becomes idle, causing delayed or missing traces.Individual OkHttp tasks already handle their own request context, so the scheduler itself should not inherit one.
flowchart LR A[Test worker<br/>okhttp.request active] B[OkHttp TaskRunner<br/>long-lived scheduler] C[Individual HTTP task] D[Request completes] A -->|🔴 previous: capture context| B B -->|scope retained until idle| R[🔴 Scope left open] A -->|🟢 request handoff| C C --> D D -->|close request scope| G[🟢 Trace is written] A -. TaskRunner excluded .-> BMotivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]