fix(desktop): WSL backend connects with Docker bridges and slow cold starts #6129
Closedrehanhaider(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/6129/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
rehanhaider(GitHub profile, opens in a new tab) changed the title
rehanhaider(GitHub profile, opens in a new tab) changed the title
- @@ -688,10 +688,15 @@688688 Effect.scoped(689689 Effect.gen(function* () {690690 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;691- // `hostname -I` prints a space-separated list of all non-loopback692- // IPs the distro has bound. The first entry on the WSL2 default693- // network is always the eth0 vEthernet address Windows can reach694- // directly (no wslhost forwarding required).695691 const command = ChildProcess.make(696692 "wsl.exe",697- [...buildDistroArgs(distro), "--", "sh", "-c", "hostname -I"],693+ // `hostname -I` orders by interface, so a Docker bridge can mask the694+ // eth0 address NAT mode needs and the host address mirrored mode maps695+ // to loopback. The default route's source is printed first and wins;696+ // the `hostname -I` tail is the fallback without iproute2.697+ [698+ ...buildDistroArgs(distro),699+ "--",700+ "sh",701+ "-c",702+ "ip -4 route get 192.0.2.1 2>/dev/null | sed -n 's/.* src \\([0-9.]*\\).*/\\1/p'; hostname -I",@@ -688,10 +688,15 @@688688 Effect.scoped(689689 Effect.gen(function* () {690690 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;691- // `hostname -I` prints a space-separated list of all non-loopback692- // IPs the distro has bound. The first entry on the WSL2 default693- // network is always the eth0 vEthernet address Windows can reach694- // directly (no wslhost forwarding required).695691 const command = ChildProcess.make(696692 "wsl.exe",697- [...buildDistroArgs(distro), "--", "sh", "-c", "hostname -I"],693+ // `hostname -I` orders by interface, so a Docker bridge can mask the694+ // eth0 address NAT mode needs and the host address mirrored mode maps695+ // to loopback. The default route's source is printed first and wins;696+ // the `hostname -I` tail is the fallback without iproute2.697+ [698+ ...buildDistroArgs(distro),699+ "--",700+ "sh",701+ "-c",702+ "ip -4 route get 192.0.2.1 2>/dev/null | sed -n 's/.* src \\([0-9.]*\\).*/\\1/p'; hostname -I",@@ -60,4 +60,5 @@6060 // failures may instead provide their own larger retryLimit when they should6161 // self-heal for a while but must not leave the app connecting forever.6262 const MAX_PREFLIGHT_FAILURE_ATTEMPTS = 5;63-const DEFAULT_BACKEND_READINESS_TIMEOUT = Duration.minutes(1);63+// One-shot probe; a WSL backend over /mnt/c regularly needs 60-98s to answer.64+const DEFAULT_BACKEND_READINESS_TIMEOUT = Duration.minutes(3);
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
d9d2e26b-2946-43d9-a691-b7e7054c3b99You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share