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
fix(lavasession): reduce second chance goroutine lifetime with periodic epoch checks
The second chance goroutine previously slept for the full 3-minute
retrySecondChanceAfter duration before checking if the epoch changed.
This caused goroutine accumulation when many providers were blocked
in quick succession during startup.
Changes:
- Replace single time.After(3min) with ticker checking every 10 seconds
- Exit early if epoch changes, reducing goroutine lifetime from 3min to ~10s
- Add trace logging for early exit to aid debugging
- Add test for early exit on epoch change behavior
This fix reduces goroutine accumulation when providers are repeatedly
blocked during startup before they become available. Instead of 251
goroutines living for 3 minutes each, they now exit within ~10 seconds
of an epoch change.
0 commit comments