imbajin commented on code in PR #362:
URL: 
https://github.com/apache/hugegraph-computer/pull/362#discussion_r3935595981


##########
vermeer/apps/common/hugegraph_tools.go:
##########
@@ -178,7 +178,7 @@ func testServerIsValid(serverAdds []string, hgSpace, 
hGraph, username, password
                wg.Add(1)
                go func(addr string, ctx context.Context, cancel 
context.CancelFunc) {
                        defer wg.Done()
-                       url := 
fmt.Sprintf("%v/graphspaces/%v/graphs/%v/schema?format=json", addr, hgSpace, 
hGraph)
+                       url := 
fmt.Sprintf("http://%v/graphspaces/%v/graphs/%v/schema?format=json";, addr, 
hgSpace, hGraph)

Review Comment:
   ⚠️ This prefixes only the request URL but returns the original `addr`. 
`FindServerAddr()` stores that value in `output.hugegraph_server` 
(`vermeer/apps/worker/compute_bl.go:518`), and `HugegraphWriter.Init()` 
concatenates it into request URLs at 
`vermeer/apps/graphio/hugegraph.go:568,591,633`. With PD returning 
`server:8080`, the probe now succeeds as `http://server:8080/...` but 
write-back constructs `server:8080/graphspaces/...`, which `http.NewRequest` 
rejects because it has no valid HTTP scheme. The same unconditional prefixing 
turns a pre-schemed address into `http://http://...` or `http://https://...`, 
whereas the old code accepted such a base URL. Normalize the address once at 
discovery, preserve an existing `http`/`https` scheme, use the normalized base 
for both read and write paths, and add raw and pre-schemed coverage.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to