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

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 ownerJune 18, 2026 14:57
@mcculls
mcculls requested review from bric3 and removed request for a teamJune 18, 2026 14:57
@mccullsmcculls added type: bug fix Bug fix comp: core Tracer core tag: no release notes Changes to exclude from release notes labels Jun 18, 2026

@bric3bric3 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
mccullsforce-pushed the mcculls/fix-context-with-bug branch from 07acb4c to 2a7aa0cCompareJune 18, 2026 15:18
@dd-octo-sts

dd-octo-stsBot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

SuiteStatus
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
ScenarioCandidatemasterΔ (95% CI of mean)
startup:insecure-bank:iast:Agent13.98 s13.90 s[-0.2%; +1.4%] (no difference)
startup:insecure-bank:tracing:Agent12.89 s12.91 s[-0.9%; +0.6%] (no difference)
startup:petclinic:appsec:Agent16.90 s16.01 s[+1.1%; +10.1%] (significantly worse)
startup:petclinic:iast:Agent17.02 s16.95 s[-0.4%; +1.3%] (no difference)
startup:petclinic:profiling:Agent16.90 s16.98 s[-1.4%; +0.5%] (no difference)
startup:petclinic:sca:Agent16.79 s16.89 s[-1.6%; +0.3%] (no difference)
startup:petclinic:tracing:Agent15.91 s16.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.

@PerfectSlayerPerfectSlayer left a comment

Copy link
Copy Markdown
Collaborator

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 queueJun 18, 2026
@dd-octo-sts

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351Bot 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-queueBot 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-cf854dBot merged commit 477a0ce into masterJun 18, 2026
582 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854dBot deleted the mcculls/fix-context-with-bug branch June 18, 2026 17:42
@github-actionsgithub-actionsBot added this to the 1.64.0 milestone Jun 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: coreTracer coretag: no release notesChanges to exclude from release notestype: bug fixBug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mcculls@bric3@PerfectSlayer