Skip to content

Commit

Permalink
Add trailing dot to storage.googleapis.com for full domain qualificat…
Browse files Browse the repository at this point in the history
…ion (ndots workaround)

This CL fully qualifies storage.googleapis.com with trailing dot to prevent libc's ndots search domain resolution. This avoids potential DNS lookup ambiguities and reduces query volume dramatically, especially on Kubernetes.

The ndots setting determines how many "dots" a domain name must have before the resolver treats it as a fully qualified domain name (FQDN). If an unqualified domain is used (e.g., "storage.googleapis.com" instead of "storage.googleapis.com."), the resolver will append configured search domains (such as default.svc.cluster.local.), leading to unintended DNS lookups and additional query volume. Adding a trailing dot (e.g., "storage.googleapis.com.") explicitly signals that the domain name is fully qualified. This prevents the resolver from appending search domains and ensures consistent DNS resolution with less query volume.

PiperOrigin-RevId: 609005660
  • Loading branch information
tensorflower-gardener committed Feb 21, 2024
1 parent abf144e commit a4e3b78
Show file tree
Hide file tree
Showing 2 changed files with 226 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ limitations under the License.

namespace tsl {
namespace {
constexpr char kGcsUriBase[] = "https://www.googleapis.com/storage/v1/";
constexpr char kGcsUriBase[] = "https://www.googleapis.com./storage/v1/";
constexpr char kGcsUploadUriBase[] =
"https://www.googleapis.com/upload/storage/v1/";
constexpr char kStorageHost[] = "storage.googleapis.com";
"https://www.googleapis.com./upload/storage/v1/";
constexpr char kStorageHost[] = "storage.googleapis.com.";
constexpr char kBucketMetadataLocationKey[] = "location";
constexpr size_t kReadAppendableFileBufferSize = 1024 * 1024; // In bytes.
constexpr int kGetChildrenDefaultPageSize = 1000;
Expand Down
Loading

0 comments on commit a4e3b78

Please sign in to comment.