temporal
temporal copied to clipboard
Unable to use passthrough:/// prefix in temporal operator command
Expected Behavior
We are setting up multi-cluster replication in Temporal, which involves configuring clusterMetadata and setting the rpcAddress for each remote cluster. In our setup, we want to explicitly specify the passthrough:/// prefix in the rpcAddress, so the gRPC client uses the passthrough resolver behavior intentionally.
This is a valid gRPC URI format supported by grpc-go, and we expect Temporal to handle addresses with the passthrough:/// prefix in clusterInformation.rpcAddress without issue.
Actual Behavior
When the rpcAddress is set to a value like passthrough:///host:port, operations that use this value — such as temporal operator cluster upsert — it still goes to default dns resolver
We think this is happening because the implementation of CreateRemoteFrontendGRPCConnection uses net.SplitHostPort to extract the hostname from the rpcAddress. We observed that using the same prefix was working for temporal health command because it was not splitting the URI Relevant code snippet from Temporal:
hostname, _, err2 := net.SplitHostPort(rpcAddress)
if err2 != nil {
d.logger.Fatal("Invalid rpcAddress for remote cluster", tag.Error(err2))
}
The net.SplitHostPort function expects a basic host:port format and fails when the address includes a URI-style scheme like passthrough:///.
Steps to Reproduce the Problem
Run temporal operator cluster upsert to connect to the remote cluster using address as passthrough:///host:port
The operation still resolves to default dns
FTR the code is located here:
https://github.com/temporalio/temporal/blob/bb507313febe5a2cb509f5aa46918d9587b086f4/common/rpc/rpc.go#L218.
I'm not sure what other locations in the code would need to change to accept passthrough:/// URLs.
We won't prioritize this work in the immediate future but would be happy to accept a contribution.
Created a PR, please review
@bergundy please review the changes for supporting url with prefix