Skip to content

fix: use net.Dial in socat for dual-stack support (Happy Eyeballs)#3692

Open
matejvasek wants to merge 2 commits intoknative:mainfrom
matejvasek:fix-socat-he
Open

fix: use net.Dial in socat for dual-stack support (Happy Eyeballs)#3692
matejvasek wants to merge 2 commits intoknative:mainfrom
matejvasek:fix-socat-he

Conversation

@matejvasek
Copy link
Copy Markdown
Contributor

Changes

ResolveTCPAddr + DialTCP resolves the hostname to a single address and dials it directly. When DNS returns both A and AAAA records (dual-stack Docker network), the IPv4 address is typically returned first. On IPv6-only pods this fails with "network is unreachable" because the pod has no IPv4 connectivity.

Switch to net.Dial which implements Happy Eyeballs (RFC 6555): it resolves all addresses, tries them concurrently with IPv6 preferred, and uses whichever connects first. The tcp4/tcp6 explicit cases are also handled correctly by net.Dial.

/kind bug

fix: in cluster dialer (socat) uses Happy Eyeballs

ResolveTCPAddr + DialTCP resolves the hostname to a single address and
dials it directly.  When DNS returns both A and AAAA records (dual-stack
Docker network), the IPv4 address is typically returned first.  On
IPv6-only pods this fails with "network is unreachable" because the pod
has no IPv4 connectivity.

Switch to net.Dial which implements Happy Eyeballs (RFC 6555): it
resolves all addresses, tries them concurrently with IPv6 preferred,
and uses whichever connects first.  The tcp4/tcp6 explicit cases are
also handled correctly by net.Dial.

Signed-off-by: Matej Vašek <matejvasek@gmail.com>
@knative-prow knative-prow Bot added the kind/bug Bugs label May 10, 2026
@knative-prow knative-prow Bot requested review from dsimansk and jrangelramos May 10, 2026 13:27
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matejvasek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label May 10, 2026
@matejvasek matejvasek requested review from gauron99 and lkingland and removed request for dsimansk and jrangelramos May 10, 2026 13:27
@knative-prow knative-prow Bot added the size/S 🤖 PR changes 10-29 lines, ignoring generated files. label May 10, 2026
Signed-off-by: Matej Vašek <matejvasek@gmail.com>
@matejvasek
Copy link
Copy Markdown
Contributor Author

PTAL @lkingland @gauron99

@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.90%. Comparing base (9ba518e) to head (de395ea).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3692      +/-   ##
==========================================
- Coverage   56.91%   56.90%   -0.01%     
==========================================
  Files         181      181              
  Lines       20933    20928       -5     
==========================================
- Hits        11913    11909       -4     
+ Misses       7811     7810       -1     
  Partials     1209     1209              
Flag Coverage Δ
e2e 36.15% <ø> (+<0.01%) ⬆️
e2e go 32.75% <ø> (ø)
e2e node 28.48% <ø> (ø)
e2e python 33.11% <ø> (-0.01%) ⬇️
e2e quarkus 28.60% <ø> (ø)
e2e rust 28.03% <ø> (ø)
e2e springboot 26.50% <ø> (-0.03%) ⬇️
e2e typescript 28.59% <ø> (ø)
e2e-config-ci 17.88% <ø> (ø)
integration 17.44% <0.00%> (+0.02%) ⬆️
unit macos-14 44.99% <100.00%> (-0.02%) ⬇️
unit macos-latest 44.99% <100.00%> (-0.02%) ⬇️
unit ubuntu-24.04-arm 45.16% <100.00%> (-0.02%) ⬇️
unit ubuntu-latest 45.84% <100.00%> (-0.02%) ⬇️
unit windows-latest 44.97% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. kind/bug Bugs size/S 🤖 PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant