feat: add TLD-level domain failover #276
Open
sesky4 wants to merge 11 commits intoTencentCloud:masterfrom
Open
feat: add TLD-level domain failover #276sesky4 wants to merge 11 commits intoTencentCloud:masterfrom
sesky4 wants to merge 11 commits intoTencentCloud:masterfrom
Conversation
7963b0e to
47ce105
Compare
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).
47ce105 to
342802f
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.