Yicong-Huang commented on code in PR #7141:
URL: https://github.com/apache/texera/pull/7141#discussion_r3691294563


##########
bin/local-dev/main.sh:
##########
@@ -466,6 +466,15 @@ fi
 # Both platform probes follow the same two steps: the interface backing the
 # default route first (most reliable on a laptop that may have wifi +
 # thunderbolt + tailscale all active), then a scan as a fallback.
+_detect_host_lan_ip_windows() {
+    local ip=""
+    ip=$(ipconfig 2>/dev/null | grep -i "IPv4" | head -n 1 | awk -F: '{print 
$2}' | tr -d '[:space:]' | tr -d '\r')

Review Comment:
   Unlike the darwin/linux probes just below, this takes the first `ipconfig` 
IPv4 with no default-route preference and no virtual-adapter filtering. On a 
Windows + Docker Desktop host — this tool's target — `ipconfig` also lists 
vEthernet (WSL) / vEthernet (Default Switch) / Hyper-V adapters, so `head -n 1` 
can pick an address containers can't route back to, reintroducing the 
unreachable-MinIO failure #7138 fixes. A `169.254.*` APIPA address also slips 
past the `!= 127.*` guard.
   
   Recommend mirroring the linux probe's two steps: prefer the adapter that has 
a default gateway (parse `ipconfig` per adapter block, or `route print` for the 
default-route interface), and skip `169.254.*` plus adapters whose description 
contains vEthernet/WSL/Hyper-V/VirtualBox/Docker.



##########
bin/local-dev/main.sh:
##########
@@ -466,6 +466,15 @@ fi
 # Both platform probes follow the same two steps: the interface backing the
 # default route first (most reliable on a laptop that may have wifi +
 # thunderbolt + tailscale all active), then a scan as a fallback.
+_detect_host_lan_ip_windows() {
+    local ip=""
+    ip=$(ipconfig 2>/dev/null | grep -i "IPv4" | head -n 1 | awk -F: '{print 
$2}' | tr -d '[:space:]' | tr -d '\r')

Review Comment:
   `tr -d '[:space:]'` already strips carriage returns (`\r` is in POSIX 
`[:space:]`), so the trailing `tr -d '\r'` is a no-op.
   ```suggestion
       ip=$(ipconfig 2>/dev/null | grep -i "IPv4" | head -n 1 | awk -F: '{print 
$2}' | tr -d '[:space:]')
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to