Repository navigation
TCP transport: resolve a host name once, IPv4 first; pod names connect - #140
Merged
Merged
Conversation
BenchPod("benchpod-c2f662.local") took about 50 s on macOS: every command dials a new
connection and looked the name up again, and a default (AF_UNSPEC) lookup of a .local name
waits about 5 s for an AAAA answer an IPv4-only pod never sends.
- TcpTransport resolves a name once (AF_INET first, AF_UNSPEC only without an IPv4 answer) and
reuses the address; a failed connect drops it so the next attempt resolves again (new DHCP
lease). TLS still gets the name as given: same pin key and SNI.
- parse_connection: a pod name (benchpod-a1b2c3, a1b2c3) is found over mDNS
(discovery.find_pod, which stops as soon as the pod answers), else usb:<name>, like the CLI.
Without zeroconf it is benchpod-<id>.local. A .local name stays a host name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BenchPod("benchpod-c2f662.local")took 51 s on macOS against 0.8 s by IP: the transport dials a new connection per command and looked the name up each time, and a default (AF_UNSPEC) lookup of a.localname waits about 5 s for an AAAA answer an IPv4-only pod never sends. The MCP server and the desktop app inherit this.TcpTransportresolves a host name once (AF_INETfirst,AF_UNSPEConly without an IPv4 answer) and reuses the address. A failed connect drops the cached address, so the next attempt resolves again (a new DHCP lease still works). IP literals are never looked up.wrap()still gets the name as given, so theknown_pods.jsonpin key and SNI are the same.parse_connection: a pod name (benchpod-a1b2c3,a1b2c3) is found on the LAN over mDNS (newdiscovery.find_pod, which stops as soon as the pod answers), elseusb:<name>, as the CLI does. Without[discovery]it becomesbenchpod-<id>.local.benchpod-<id>.localstays a host name.Tests:
tests/test_tcp_resolve.pypatchesgetaddrinfo: one lookup for 10 commands, IPv4 first, re-resolve after a refused connect, TLS gets the name, pod-name parsing. Simulated lookup time for 10 commands: 50.00 s on main, 0.04 s here. No hardware used.🤖 Generated with Claude Code