mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-05 18:12:58 +00:00
19dfd3040c
A tenant monitor's Start goroutine assigned discoveryService in startModeRuntime without holding m.mu, while request handlers such as auto-register read it through GetDiscoveryService. The race detector flagged the pair intermittently in TestTenantProxmoxInstallTokenGrantLivesOnInstanceRecord and failed unrelated pull requests. startModeRuntime now chooses and assigns the service under m.mu, and GetDiscoveryService reads it under the read lock, matching StartDiscoveryService and StopDiscoveryService. The org ID is read directly because GetOrgID would take the read lock again. A new race proof calls startModeRuntime and GetDiscoveryService from two goroutines with no ordering between them. Contract-Neutral: Locking fix for an existing monitor field; no API, schema, discovery behavior or subsystem contract change.