Skip to content

Servlet: avoid NPE when headerNames is null#11394

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
andrea.marziali/servlet
May 18, 2026
Merged

Servlet: avoid NPE when headerNames is null#11394
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
andrea.marziali/servlet

Conversation

@amarziali
Copy link
Copy Markdown
Contributor

What Does This Do

headerNames can return null as per the servlet javadoc. This PR puts some guards to avoid errors like:

java.lang.NullPointerException
  at datadog.trace.instrumentation.servlet3.HttpServletExtractAdapter.forEachKey(HttpServletExtractAdapter.java:20)
  at datadog.trace.bootstrap.instrumentation.api.AgentPropagation$ContextVisitor.forEachKeyValue(AgentPropagation.java:49)
  at

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

@amarziali amarziali requested review from a team as code owners May 18, 2026 09:01
@amarziali amarziali added type: bug Bug report and fix inst:servlet Servlet instrumentation labels May 18, 2026
@amarziali amarziali requested review from ValentinZakharov and removed request for a team May 18, 2026 09:01
@amarziali amarziali added the tag: telemetry error reported Reported by error telemetry label May 18, 2026
@amarziali amarziali requested a review from ygree May 18, 2026 09:01
Copy link
Copy Markdown
Contributor

@ValentinZakharov ValentinZakharov left a comment

Choose a reason for hiding this comment

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

LGTM

@amarziali amarziali enabled auto-merge May 18, 2026 09:35
@amarziali amarziali added this pull request to the merge queue May 18, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 18, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

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

View all feedbacks in Devflow UI.

2026-05-18 09:56:07 UTC ℹ️ Start processing command /merge


2026-05-18 09:56:12 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-05-18 11:05:09 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 May 18, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit ef9d47c into master May 18, 2026
593 of 600 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the andrea.marziali/servlet branch May 18, 2026 11:05
@github-actions github-actions Bot added this to the 1.63.0 milestone May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst:servlet Servlet instrumentation tag: telemetry error reported Reported by error telemetry type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants