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
{{ message }}
Repository navigation
RedisRecordStore re-arm: a failed attempt's .catch can clear a newer memo (microtask race) #428
Follow-up from #427, P6 on Kubernetes slice 1 (#423). The final review of the RedisRecordStore re-arm fix found this.
Where:harness/src/pool-records.ts, connectOnce. Its .catch clears this.ready unconditionally.
Race:
A re-arm attempt fails. node-redis sets isOpen = false synchronously inside #shouldReconnect, but the rejection takes several microtasks to reach the .catch.
A store call landing in that window takes the !isOpen branch and starts a second connect().
The first .catch then wipes that second memo.
A third caller calls connect() on a socket that is now open and gets Socket already opened.
Impact: the window is microtask-only, and callers retry through timers or I/O, so in practice it is very unlikely. The cost is one failed call until the next retry.
Fix (one line): hold the attempt in a local p, and clear the memo only if this.ready === p. Add a test that interleaves two callers around a failed re-arm.
Activity
fix(harness): RedisRecordStore re-arm clears only its own memo (#428)