From 23443c15b0c775dc3339ca88fb9f966cf74905a2 Mon Sep 17 00:00:00 2001 From: "skill-sync[bot]" Date: Thu, 14 May 2026 18:57:39 +0000 Subject: [PATCH 1/2] Implement planned topic: 0035-dns-resolver-config Add DNS Resolver Configuration section to references/python/advanced-features.md documenting temporalio.service.DnsLoadBalancingConfig: the resolution_interval_millis field, the default classvar, the Client.connect / CloudOperationsClient.connect kwargs, and the silent mutual-exclusion with HttpConnectProxyConfig. Anchored to sdk-python v1.27.2 source (the official docs site does not yet cover this class). Co-Authored-By: Claude Opus 4.7 --- references/python/advanced-features.md | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/references/python/advanced-features.md b/references/python/advanced-features.md index c5ec1b3..714f7d3 100644 --- a/references/python/advanced-features.md +++ b/references/python/advanced-features.md @@ -114,6 +114,39 @@ worker = Worker( ) ``` +## DNS Resolver Configuration + +`DnsLoadBalancingConfig` makes Core periodically re-resolve the client's target host and round-robin requests across the resolved addresses . Use it when `target_host` resolves to multiple A/AAAA records (e.g., a load-balanced gRPC frontend, multi-address private endpoints) and you want the client to spread RPCs across them. + +It is **not** the mechanism that makes Temporal Cloud HA failover work — failover is driven by Temporal Cloud rewriting a CNAME record and the OS resolver re-resolving on TTL expiry (`docs/cloud/high-availability/ha-connectivity.mdx:25-31`). + +### Configuration + +```python +from temporalio.client import Client +from temporalio.service import DnsLoadBalancingConfig + +client = await Client.connect( + "frontend.example.internal:7233", + dns_load_balancing_config=DnsLoadBalancingConfig( + resolution_interval_millis=5000, # re-resolve every 5 seconds + ), +) +``` + +- The only field is `resolution_interval_millis: int = 30000` — how often to re-resolve DNS, in milliseconds. +- `DnsLoadBalancingConfig.default` is a pre-built instance with the default 30-second interval. +- The `Client.connect` kwarg is `dns_load_balancing_config: DnsLoadBalancingConfig | None = None` . Per the docstring: *"Default is to re-resolve DNS every 30s. Can be set to `None` to disable. Silently disabled when `http_connect_proxy_config` is set, since the two are mutually exclusive."* +- Pass `dns_load_balancing_config=None` to disable DNS load balancing entirely. + +### Mutual exclusion with HTTP CONNECT proxy + +DNS load balancing and `HttpConnectProxyConfig` cannot be used together. When `http_connect_proxy_config` is set on the same client, DNS load balancing is **silently disabled** — there is no error and no precedence flag. If you need both, you cannot have both; choose the one your network requires. + +### CloudOperationsClient + +`CloudOperationsClient.connect` accepts the same `dns_load_balancing_config` kwarg , but its documented default differs: *"Default is disabled. Silently disabled when `http_connect_proxy_config` is set, since the two are mutually exclusive."* + ## Workflow Init Decorator You should always put state initialization logic in the `__init__` of your workflow class, so that it happens before signals/updates arrive. From a82d312b6784f4c9c09f32506362bb9a32e68484 Mon Sep 17 00:00:00 2001 From: "skill-sync[bot]" Date: Thu, 14 May 2026 19:04:18 +0000 Subject: [PATCH 2/2] Finalize draft for 0035-dns-resolver-config --- references/java/integrations/spring-ai.md | 1 - references/python/advanced-features.md | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/references/java/integrations/spring-ai.md b/references/java/integrations/spring-ai.md index 5ee0704..ae5154f 100644 --- a/references/java/integrations/spring-ai.md +++ b/references/java/integrations/spring-ai.md @@ -217,7 +217,6 @@ Media image = new Media(MimeTypeUtils.IMAGE_PNG, URI.create("https://cdn.example For anything larger than a small thumbnail, route the bytes to a binary store from an Activity and pass only the URL across the conversation. - ## Vector stores, embeddings, and MCP When the corresponding Spring AI modules (`spring-ai-rag`, `spring-ai-mcp`) are on the classpath, the integration registers Activities for vector stores, embeddings, and MCP tool calls automatically. Inject the matching Spring AI types into your Activities or Workflows and use them as you would in any Spring AI application — each operation executes through a Temporal Activity. diff --git a/references/python/advanced-features.md b/references/python/advanced-features.md index 714f7d3..5ee7aff 100644 --- a/references/python/advanced-features.md +++ b/references/python/advanced-features.md @@ -116,7 +116,7 @@ worker = Worker( ## DNS Resolver Configuration -`DnsLoadBalancingConfig` makes Core periodically re-resolve the client's target host and round-robin requests across the resolved addresses . Use it when `target_host` resolves to multiple A/AAAA records (e.g., a load-balanced gRPC frontend, multi-address private endpoints) and you want the client to spread RPCs across them. +`DnsLoadBalancingConfig` makes Core periodically re-resolve the client's target host and round-robin requests across the resolved addresses . Use it when `target_host` resolves to multiple A/AAAA records (e.g., a load-balanced gRPC frontend, multi-address private endpoints) and you want the client to spread RPCs across them. It is **not** the mechanism that makes Temporal Cloud HA failover work — failover is driven by Temporal Cloud rewriting a CNAME record and the OS resolver re-resolving on TTL expiry (`docs/cloud/high-availability/ha-connectivity.mdx:25-31`). @@ -134,18 +134,18 @@ client = await Client.connect( ) ``` -- The only field is `resolution_interval_millis: int = 30000` — how often to re-resolve DNS, in milliseconds. -- `DnsLoadBalancingConfig.default` is a pre-built instance with the default 30-second interval. -- The `Client.connect` kwarg is `dns_load_balancing_config: DnsLoadBalancingConfig | None = None` . Per the docstring: *"Default is to re-resolve DNS every 30s. Can be set to `None` to disable. Silently disabled when `http_connect_proxy_config` is set, since the two are mutually exclusive."* +- The only field is `resolution_interval_millis: int = 30000` — how often to re-resolve DNS, in milliseconds. +- `DnsLoadBalancingConfig.default` is a pre-built instance with the default 30-second interval. +- The `Client.connect` kwarg is `dns_load_balancing_config: DnsLoadBalancingConfig | None = None` . Per the docstring: *"Default is to re-resolve DNS every 30s. Can be set to `None` to disable. Silently disabled when `http_connect_proxy_config` is set, since the two are mutually exclusive."* - Pass `dns_load_balancing_config=None` to disable DNS load balancing entirely. ### Mutual exclusion with HTTP CONNECT proxy -DNS load balancing and `HttpConnectProxyConfig` cannot be used together. When `http_connect_proxy_config` is set on the same client, DNS load balancing is **silently disabled** — there is no error and no precedence flag. If you need both, you cannot have both; choose the one your network requires. +DNS load balancing and `HttpConnectProxyConfig` cannot be used together. When `http_connect_proxy_config` is set on the same client, DNS load balancing is **silently disabled** — there is no error and no precedence flag. If you need both, you cannot have both; choose the one your network requires. ### CloudOperationsClient -`CloudOperationsClient.connect` accepts the same `dns_load_balancing_config` kwarg , but its documented default differs: *"Default is disabled. Silently disabled when `http_connect_proxy_config` is set, since the two are mutually exclusive."* +`CloudOperationsClient.connect` accepts the same `dns_load_balancing_config` kwarg , but its documented default differs: *"Default is disabled. Silently disabled when `http_connect_proxy_config` is set, since the two are mutually exclusive."* ## Workflow Init Decorator