I've ran some tests as follow, failed to see the load balancing in both go1.22 and go1.23.
1. setup a coredns to provide dns service. 2. assign additional IP to the NIC. 3. run 2 http server with flask on each IP address. 4. using http.client to request that server. So I dout if that is a Go behavior changing. I have a not so clever suggestion if you have some time. With git bisect, compiling the Go source code, to find the very commit 'causing' the changing. On Saturday, 28 September 2024 at 05:07:29 UTC+8 Nishant Gupta wrote: > Hi, > > I have a headless k8s service for which the local DNS resolver gives all > the IPs of the pods sitting behind the service. The requests made to the > service are not getting load balanced with go1.22.7 and all the requests go > to a single pod. The HTTP client is invoked using the following snippet: > > ``` > > for { client := &http.Client{ Timeout: 95 * time.Second, } req, err := > http.NewRequest("GET", "http://<service-name>:<port>", nil) if err != nil > { fmt.Println("Error creating request:", err) return } resp, err := > client.Do(req) if err != nil { fmt.Println("Error making request:", err) > return } defer resp.Body.Close() time.Sleep(5 * time.Second) } > > ``` > > Requests made from the above with go1.23.1 are getting load balanced > appropriately(not sure if it’s round robin though). I compared the > transport logic for both the versions but couldn’t find anything concrete > which could cause this problem. Can you experts please help me out? > > Thanks, > Nishant > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/09945e55-b906-4116-9222-ab336a777dd3n%40googlegroups.com.