Skip to content

consomme: improve tracing for TCP connections and DNS request handling#3424

Merged
benhillis merged 8 commits intomicrosoft:mainfrom
damanm24:dns-debug
May 6, 2026
Merged

consomme: improve tracing for TCP connections and DNS request handling#3424
benhillis merged 8 commits intomicrosoft:mainfrom
damanm24:dns-debug

Conversation

@damanm24
Copy link
Copy Markdown
Contributor

@damanm24 damanm24 commented May 5, 2026

Currently TCP traces do not include the four-tuple as part of the message body. This makes diagnosing TCP related issues difficult since it's impossible to associate tracing messages with the connection. DNS request handling has a similar issue, where requests do not have a unique id associated with them - making it difficult to track the request handling flow throughout consommé.

The changes in this PR should make it easier to debug issues in CI related to TCP and/or DNS.

damanm24 and others added 6 commits April 28, 2026 15:11
.
Co-authored-by: Copilot <copilot@github.com>
.
Co-authored-by: Copilot <copilot@github.com>
.
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 20:57
@damanm24 damanm24 requested a review from a team as a code owner May 5, 2026 20:57
@github-actions github-actions Bot added the unsafe Related to unsafe code label May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

⚠️ Unsafe Code Detected

This PR modifies files containing unsafe Rust code. Extra scrutiny is required during review.

For more on why we check whole files, instead of just diffs, check out the Rustonomicon

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves debuggability of net_consomme by enriching tracing for TCP connections (adding the 4-tuple) and by introducing a per-DNS-query identifier that can be propagated into backend tracing (notably on Windows), making it easier to correlate logs in CI.

Changes:

  • Include TCP source/destination socket addresses in trace_tcp_packet output and add additional TCP/DNS-handler trace points.
  • Refactor DnsFlow to store src/dst as SocketAddr (instead of IP+port fields), simplifying logging and call sites.
  • Add a monotonically increasing query_id in DnsResolver and pass it into DNS backend implementations for correlation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vm/devices/net/net_consomme/consomme/src/udp.rs Switch UDP DNS flow tracking to SocketAddr and update response logging/packet construction accordingly.
vm/devices/net/net_consomme/consomme/src/tcp.rs Add 4-tuple to TCP packet tracing and enrich TCP/DNS-handler traces with src/dst.
vm/devices/net/net_consomme/consomme/src/dns_resolver/mod.rs Refactor DnsFlow to SocketAddr and add query_id generation/plumbing through the DnsBackend trait.
vm/devices/net/net_consomme/consomme/src/dns_resolver/unix/mod.rs Thread query_id into the Unix DNS backend internal request dispatch.
vm/devices/net/net_consomme/consomme/src/dns_resolver/windows/mod.rs Thread query_id into Windows DNS backend, add tracing, and rename slab key tracking for pending requests.
vm/devices/net/net_consomme/consomme/src/dns_resolver/dns_tcp.rs Update TCP DNS handler tracing to include src/dst and adapt to the new backend query_id parameter.

Comment thread vm/devices/net/net_consomme/consomme/src/dns_resolver/windows/mod.rs Outdated
Comment thread vm/devices/net/net_consomme/consomme/src/dns_resolver/dns_tcp.rs Outdated
Comment thread vm/devices/net/net_consomme/consomme/src/tcp.rs Outdated
damanm24 and others added 2 commits May 5, 2026 14:43
.
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 22:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread vm/devices/net/net_consomme/consomme/src/dns_resolver/mod.rs
Comment thread vm/devices/net/net_consomme/consomme/src/dns_resolver/unix/mod.rs
@benhillis benhillis merged commit ccdbc54 into microsoft:main May 6, 2026
92 of 95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unsafe Related to unsafe code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants