You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
issue/presence-start-guard: guard PresenceManager.Start against duplicate sweep goroutines
Start() now uses sync.Once (mirroring the existing stopOnce pattern) to
ensure only one sweep loop is ever spawned per PresenceManager instance.
Adds two regression tests:
- TestPresenceManager_Start_Idempotent: counts goroutines before/after
multiple Start() calls to assert no duplicate sweep loops spawn.
- TestPresenceManager_ExpireCallback_OncePerExpiration: counts callback
invocations across multiple sweep cycles to assert the callback fires
at most once per expired node lease.
Verification: temporarily reverted the startOnce guard and confirmed
TestPresenceManager_Start_Idempotent fails with delta=3 (3 extra
goroutines spawned by duplicate Start() calls), proving the regression
test catches the bug. Restored the guard; all presence manager tests
pass and go vet is clean.
0 commit comments