This PR implements a simplified version of Happy Eyeballs (RFC 8305) to improve connection fallback behavior when IPv6 is unavailable or slow.
When ch_open() tries to connect to a hostname that resolves to multiple addresses (e.g., both IPv6 and IPv4), the current implementation:
waittime for all connection attemptsThis is particularly problematic in environments where:
Distribute the waittime across multiple addresses using a strategy based on RFC 8305:
This ensures that IPv4 fallback has sufficient time to succeed even when IPv6 connection attempts fail or timeout.
channel_open() in src/channel.c to:
src/testdir/test_channel.vim pass, particularly Test_connect_waittime() which verifies basic timeout behaviorAI Disclosure: This contribution was developed with assistance from Claude Code (Claude Sonnet 4.5). All code follows the Vim coding style guidelines and has been tested for correctness.
https://github.com/vim/vim/pull/19233
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks, can you think of a test for this? I'll move this to after the 9.2 release however.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thank you for your review! I (with Claude Code) can add tests, but first let me explain the issue.
The existing Test_connect_waittime() verifies that waittime is respected during connection attempts. This ensures that the timeout distribution logic does not compromise basic behavior.
To specifically test IPv6→IPv4 fallback, we need:
Reproducibility is difficult to ensure in the CI environment (due to IPv6 availability fluctuations, timing dependencies, etc.).
Test_connect_waittime() verifies the core mechanismWhich approach is preferable? Implement Option 3 if deemed important, but want to confirm before adding significant test infrastructure.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()