A user session check that happens while Redis is offline/restarting invalidates and clears the session even if it would be valid when Redis comes back online
Created by: pjlast
Whenever a user session needs to be authenticated, Redis is checked. If Redis happens to be restarting while this check happens, the check immediately fails and clears the user session, causing the user to be logged out. While this shouldn't happen too often, it can be annoying when using the k8s dogfood instance, as deploys happen often, and it could also happen to on-prem customers when they upgrade (altho this would be far less frequent and unlikely).
The code that causes this to happen can be found here: https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/cmd/frontend/internal/session/session.go?L344
It can be replicated locally by doing a brew services restart redis
and then refreshing your local Sourcegraph page.