in monitored_cache.go [126:146]
func (c *monitoredCache) checkDomainName(ctx context.Context) {
if !c.cn.HasDomainName() {
return
}
newCn, err := c.resolver.Resolve(ctx, c.cn.DomainName())
if err != nil {
// The domain name could not be resolved.
c.logger.Debugf(ctx, "domain name %s for instance %s did not resolve, "+
"closing all connections: %v",
c.cn.DomainName(), c.cn.Name(), err)
c.Close()
}
if newCn != c.cn {
// The instance changed.
c.logger.Debugf(ctx, "domain name %s changed from %s to %s, "+
"closing all connections.",
c.cn.DomainName(), c.cn.Name(), newCn.Name())
c.Close()
}
}