fix: revalidatePoolSettings bypasses client cache with WithSkipCache#379
Conversation
Revalidation was reading from the 1h in-memory cache instead of making a fresh HTTP request. Added WithSkipCache() to detect 403 (tenant suspended/purged) promptly. X-Lerian-Ref: 0x1
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis pull request modifies the asynchronous settings revalidation logic in both the Mongo and Postgres tenant managers. The 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Summary
revalidatePoolSettingsin bothtmpostgres.Managerandtmmongo.Managerwas callingGetTenantConfigwithoutWithSkipCache(). The 1h in-memory cache returned stale "active" config, preventing detection of tenant suspension/purge (403 response).Fix
Added
client.WithSkipCache()to theGetTenantConfigcall inrevalidatePoolSettingsfor both managers. Revalidation now makes a fresh HTTP request to tenant-manager every check interval.Test plan
go test -race ./commons/tenant-manager/postgres/... ./commons/tenant-manager/mongo/...— pass