From 38e028fbe6685456ba9a92f312488577716a063c Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Fri, 23 Oct 2026 20:16:51 +0200 Subject: [PATCH] fix(19.7): RA-IN-01 describe the Redis store's mount-time warm-up correctly lazyStore's and newStore's doc comments no longer claim that nothing dials at mount: Mount starts a background warm-up that dials Redis with a backoff and logs each failed attempt. The comment records the decision to keep the warm-up for commands that mount pier without serving, such as route:list: it only dials and logs until the process exits. --- modules/pier/pier.go | 8 ++++---- modules/pier/store_redis.go | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/pier/pier.go b/modules/pier/pier.go index 4f790524..4a2f990a 100644 --- a/modules/pier/pier.go +++ b/modules/pier/pier.go @@ -150,10 +150,10 @@ func Mount(host Host, app *backpack.App, plugins []party.Plugin) error { } // newStore builds the session store mcp.sessions.store selects: the memory -// store, subscribed to its own events at once, or a Redis store opened on -// first use from redis.url under cooler's key prefix (nothing dials at -// mount itself; a background warm-up opens it with a backoff, and a missing -// URL is a 503 on stateful requests, logged). +// store, subscribed to its own events at once, or a Redis store opened +// from redis.url under cooler's key prefix by a background warm-up that +// Mount starts (Mount itself never waits for it); a missing URL is a 503 on +// stateful requests, logged. func (p *Pier) newStore() Store { if p.cfg.SessionStore != StoreRedis { ms := newMemoryStore() diff --git a/modules/pier/store_redis.go b/modules/pier/store_redis.go index 5453c058..3802e405 100644 --- a/modules/pier/store_redis.go +++ b/modules/pier/store_redis.go @@ -228,9 +228,14 @@ func (s *redisStore) Subscribe(ctx context.Context, fn func(Event)) error { return nil } -// lazyStore opens the Redis store on first use, so nothing dials at mount -// (route:list and tests never dial) and a missing redis.url is a 503 on the -// first request, logged once, not a boot failure (cooler's rule). +// lazyStore opens the Redis store without blocking Mount: Mount starts warm, +// which dials in the background with a backoff (every failure logged as +// "session store not open yet, retrying"), and the first request of any +// path kicks an open too. A missing or unreachable Redis is therefore never +// a boot failure (cooler's rule): stateful requests answer 503 until the +// store opens, and the missing redis.url is logged once. A command that +// mounts pier without serving (route:list) also starts the warm-up; it only +// dials and logs until the process exits, so it is not skipped there. type lazyStore struct { open func(ctx context.Context) (Store, error) mu sync.Mutex