Skip to content

feat: add TLD-level domain failover #276

Open
sesky4 wants to merge 11 commits intoTencentCloud:masterfrom
sesky4:endpoint-fallback
Open

feat: add TLD-level domain failover #276
sesky4 wants to merge 11 commits intoTencentCloud:masterfrom
sesky4:endpoint-fallback

Conversation

@sesky4
Copy link
Copy Markdown
Contributor

@sesky4 sesky4 commented Apr 20, 2026

No description provided.

@sesky4 sesky4 changed the title feat: add TLD-level domain failover for all signing methods feat: add TLD-level domain failover Apr 20, 2026
@sesky4 sesky4 force-pushed the endpoint-fallback branch from 7963b0e to 47ce105 Compare April 21, 2026 10:11
Adds EndpointFailoverInterceptor that automatically retries against backup
TLDs (.cn, .com.cn) when the primary tencentcloudapi.com domain fails due
to DNS, TLS verification, or network reachability issues.

The interceptor recovers all signing inputs from the outgoing Request and
re-signs against the backup host using credentials/profile read live from
the owning AbstractClient, so credential rotation is honoured on every
retry. No per-request tag is required.

Per-TLD CircuitBreakers (60s timeout) suppress repeated attempts against
a failing TLD and probe recovery via half-open. Failover is opt-out via
ClientProfile.setDomainFailover(false).
@sesky4 sesky4 force-pushed the endpoint-fallback branch from 47ce105 to 342802f Compare April 24, 2026 09:42
sesky4 added 10 commits April 27, 2026 10:53
Failover toggle now lives on HttpProfile alongside other transport-layer
options (apigwEndpoint, timeouts, proxy). EndpointFailoverInterceptor and
its breaker timeout constant are package-private — users opt out solely
via HttpProfile.setDomainFailover(false), not by touching the interceptor.
Reprobe the user's original Tencent Cloud API domain after the breaker cooldown so traffic can automatically return once the primary TLD recovers.
Add coverage for the cooldown-based reprobe path while keeping the existing preference for the last known working TLD before cooldown expires.
Unsigned V3 endpoints still need TLD rewrite when primary domain
fails, so treat `Authorization: SKIP` as rewrite-only instead of
excluding it from failover eligibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant