Skip to content

Commit

Permalink
credentials/alts: avoid SRV and TXT lookups for handshaker service (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
townba authored Nov 22, 2024
1 parent 44a5eb9 commit 93f1cc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion credentials/alts/internal/handshaker/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ func Dial(hsAddress string) (*grpc.ClientConn, error) {
if !ok {
// Create a new connection to the handshaker service. Note that
// this connection stays open until the application is closed.
// Disable the service config to avoid unnecessary TXT record lookups that
// cause timeouts with some versions of systemd-resolved.
var err error
hsConn, err = grpc.Dial(hsAddress, grpc.WithTransportCredentials(insecure.NewCredentials()))
hsConn, err = grpc.Dial(hsAddress, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDisableServiceConfig())
if err != nil {
return nil, err
}
Expand Down
4 changes: 3 additions & 1 deletion internal/resolver/dns/dns_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ func (d *dnsResolver) watcher() {
}

func (d *dnsResolver) lookupSRV(ctx context.Context) ([]resolver.Address, error) {
if !EnableSRVLookups {
// Skip this particular host to avoid timeouts with some versions of
// systemd-resolved.
if !EnableSRVLookups || d.host == "metadata.google.internal." {
return nil, nil
}
var newAddrs []resolver.Address
Expand Down

0 comments on commit 93f1cc1

Please sign in to comment.