Skip to content

Fix Context.with(null) edge-case#11672

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
mcculls/fix-context-with-bug
Jun 18, 2026
Merged

Fix Context.with(null) edge-case#11672
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
mcculls/fix-context-with-bug

Conversation

@mcculls

@mcculls mcculls commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Fix bug where calling context.with((ImplicitContextKeyed) null) drops all other elements.

Motivation

Found while discussing this part of the codebase with Claude

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@mcculls
mcculls requested a review from a team as a code owner June 18, 2026 14:57
@mcculls
mcculls requested review from bric3 and removed request for a team June 18, 2026 14:57
@mcculls mcculls added type: bug fix Bug fix comp: core Tracer core tag: no release notes Changes to exclude from release notes labels Jun 18, 2026
@mcculls
mcculls requested a review from PerfectSlayer June 18, 2026 14:58

@bric3 bric3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found while discussing this part of the codebase with Claude

Nice

@datadog-prod-us1-6

This comment has been minimized.

@mcculls
mcculls force-pushed the mcculls/fix-context-with-bug branch from 07acb4c to 2a7aa0c Compare June 18, 2026 15:18
@dd-octo-sts

dd-octo-sts Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.98 s 13.90 s [-0.2%; +1.4%] (no difference)
startup:insecure-bank:tracing:Agent 12.89 s 12.91 s [-0.9%; +0.6%] (no difference)
startup:petclinic:appsec:Agent 16.90 s 16.01 s [+1.1%; +10.1%] (significantly worse)
startup:petclinic:iast:Agent 17.02 s 16.95 s [-0.4%; +1.3%] (no difference)
startup:petclinic:profiling:Agent 16.90 s 16.98 s [-1.4%; +0.5%] (no difference)
startup:petclinic:sca:Agent 16.79 s 16.89 s [-1.6%; +0.3%] (no difference)
startup:petclinic:tracing:Agent 15.91 s 16.04 s [-1.8%; +0.2%] (no difference)

Commit: 2a7aa0c3 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@PerfectSlayer PerfectSlayer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make sense. Thanks for the fix.
Hopefully it won’t impact products / features that depended on the wrong behavior.

Note that some other with API throws exceptions with null keys (so another option would be to through exception too with null ImplicitContextKeyed objects) but I feel silently ignoring the value is still the right thing to do as this method is supposed to bring convenience...

@mcculls
mcculls enabled auto-merge June 18, 2026 15:41
@mcculls
mcculls added this pull request to the merge queue Jun 18, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jun 18, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-06-18 16:33:42 UTC ℹ️ Start processing command /merge


2026-06-18 16:33:46 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-06-18 17:42:59 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 18, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 477a0ce into master Jun 18, 2026
582 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the mcculls/fix-context-with-bug branch June 18, 2026 17:42
@github-actions github-actions Bot added this to the 1.64.0 milestone Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: no release notes Changes to exclude from release notes type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants