Found in the review of #240 (merged). Related: #94, #240.
providers/azure/services/database/client.go:719 and :730 call c.serverInfoOnce.Do(func() { c.azConfig, c.deployment = c.fetchServerInfo(ctx) }). fetchServerInfo (:744) returns empty values when a pager page errors or the context is cancelled, and sync.Once never runs again. After #240 empty means the explicit unknown, so every later AZConfig/Deployment lookup in the process reports unknown for the life of the client.
Failure scenario (probed in the #240 review): the first NextPage returns an error, the next call would succeed. The first lookup returns empty; the second lookup also returns empty because the Once is spent.
Suggested fix: replace sync.Once with a mutex and cache only a complete walk. Add a bound or backoff so a subscription that keeps erroring does not re-walk every server page on every recommendation.
Acceptance: a transient first-page error followed by a successful walk yields populated AZConfig/Deployment on the next lookup, covered by a test.
Found in the review of #240 (merged). Related: #94, #240.
providers/azure/services/database/client.go:719and:730callc.serverInfoOnce.Do(func() { c.azConfig, c.deployment = c.fetchServerInfo(ctx) }).fetchServerInfo(:744) returns empty values when a pager page errors or the context is cancelled, andsync.Oncenever runs again. After #240 empty means the explicit unknown, so every later AZConfig/Deployment lookup in the process reports unknown for the life of the client.Failure scenario (probed in the #240 review): the first
NextPagereturns an error, the next call would succeed. The first lookup returns empty; the second lookup also returns empty because the Once is spent.Suggested fix: replace
sync.Oncewith a mutex and cache only a complete walk. Add a bound or backoff so a subscription that keeps erroring does not re-walk every server page on every recommendation.Acceptance: a transient first-page error followed by a successful walk yields populated AZConfig/Deployment on the next lookup, covered by a test.