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
…7861) (#7873)

Co-authored-by: Brad Town <townba@users.noreply.github.com>
  • Loading branch information
dfawley and townba authored Nov 26, 2024
1 parent eff4b16 commit dc26fee
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 dc26fee

Please sign in to comment.