Skip to content

fix(lock): fail closed when Redis unavailable for financial operations - #218

Open
BWM0223 wants to merge 1 commit into
vespera-labs:mainfrom
BWM0223:fix/lock-inmemory-fallback
Open

fix(lock): fail closed when Redis unavailable for financial operations#218
BWM0223 wants to merge 1 commit into
vespera-labs:mainfrom
BWM0223:fix/lock-inmemory-fallback

Conversation

@BWM0223

@BWM0223 BWM0223 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #33 - Distributed lock falls back to per-process in-memory map

Root Cause

LockService uses localLockMap when this.redis is falsy, giving no cross-instance protection for financial flows (recordPayment, escrow ops).

Fix

  • acquireLock with failClosed=true (default) throws DistributedLockError when Redis unavailable
  • Financial operations cannot proceed without distributed lock
  • Non-financial ops can explicitly opt into local fallback
  • Clear error logging distinguishes fail-closed from fallback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Distributed lock falls back to a per-process in-memory map, giving no cross-instance protection

1 participant