Skip to content

fix(p/HUAWEICLOUD): guard zone cache for concurrency and retry all API calls - #5172

Merged
TomOnTime merged 3 commits into
DNSControl:mainfrom
huihuimoe:huaweicloud-concurrency-retry
Dec 5, 2026
Merged

TomOnTime merged 3 commits into
DNSControl:mainfrom
huihuimoe:huaweicloud-concurrency-retry

Conversation

@huihuimoe

Copy link
Copy Markdown
Member

this PR fixes concurrent zone cache access in the Huawei Cloud provider and adds missing rate-limit retries to the remaining API calls.

now safely supports concurrency (CanConcur: providers.Can()).

Summary

  • Protect zoneIDByDomain with sync.RWMutex and immutable copy-on-write snapshots via getZonesMap().
  • Publish zoneIDByDomain only after all pages of ListPublicZones succeed, so partial failures do not poison the cache.
  • Remove unused domainByZoneID field and pass zoneID directly to getDNSSECCorrections.
  • Return an error in GetNameservers when the zone is not found instead of calling the API with an empty zone ID.
  • Wrap ListPublicZones, CreatePublicZone, and ShowPublicZoneNameServer with withRetry.
  • Explicitly declare CanConcur: providers.Can() on HUAWEICLOUD.
  • Add unit tests in listzones_test.go covering concurrent zone loading, mid-pagination failure, and rate-limit retries.

Testing

  • go vet ./providers/huaweicloud/: PASS.
  • go test -race -v -count=1 ./providers/huaweicloud/: PASS (4/4).
  • go build, bin/fmtjson-all.sh, go generate ./..., go fmt ./..., go fix ./...: clean.

@huihuimoe
huihuimoe requested a review from TomOnTime as a code owner December 3, 2026 09:09
TomOnTime and others added 2 commits December 5, 2026 08:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TomOnTime
TomOnTime merged commit c596f91 into DNSControl:main Dec 5, 2026
10 checks passed
@TomOnTime

Copy link
Copy Markdown
Collaborator

Thank you for fixing this! Users with many domains will really appreciate this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants