Skip to content

Version 5.1.1: ignore Redis errors when releasing a mutex lock handle - #82

Merged
freshlogic merged 1 commit into
mainfrom
mutex-dispose-ignore-errors
Oct 26, 2026
Merged

freshlogic merged 1 commit into
mainfrom
mutex-dispose-ignore-errors

Conversation

@freshlogic

Copy link
Copy Markdown
Member

Summary

  • The lock handle's [Symbol.asyncDispose] now ignores errors from the compare-and-delete, the same way the semaphore functions ignore unlock errors. The lock expires via its TTL.
  • Before, in 5.1.0, a Redis error during release (for example while the client is reconnecting with disableOfflineQueue: true) made the await using block throw after its work succeeded. In catalog-service's Service Bus handlers, that redelivers a message that was already handled. If the block also threw, the block's error came out wrapped in a SuppressedError.
  • README and CHANGELOG (5.1.1, Fixed). package.json version 5.1.1.

Tests

  • PettyCache.mutex.lock handle should ignore Redis EVAL errors: with EVAL stubbed to reject, the release resolves, and an await using block that throws rejects with its own Error, not a SuppressedError. This test fails against 5.1.0's index.js.

🤖 Generated with Claude Code

Disposing the handle rejected when the compare-and-delete failed, so an
await using block threw after its work succeeded, or wrapped its own
error in a SuppressedError. Ignore the error like the semaphore
functions do; the lock expires via its TTL.

Version 5.1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@freshlogic
freshlogic merged commit bc81c49 into main Oct 26, 2026
1 check passed
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 40391363468

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 3 of 3 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 861
Covered Lines: 861
Line Coverage: 100.0%
Relevant Branches: 227
Covered Branches: 227
Branch Coverage: 100.0%
Branches in Coverage %: Yes
Coverage Strength: 53.26 hits per line

💛 - Coveralls

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.

2 participants