Skip to content

How to distinguish Redis unavailability from lock contention in TryAcquireAsync? #242

Description

@unzeitip

Hi, first of all, thank you for this great library — it’s been very helpful for us! 🙏

I have a question regarding how RedisDistributedLock.TryAcquireAsync behaves when Redis is unavailable (e.g., Redis crash, network failure, OOM).

From what I can see during my testing, when Redis is down, TryAcquireAsync seems to just return null, without throwing any exception.
This makes it hard to distinguish between:

  • the lock being already held (normal contention), and
  • Redis being unreachable (infrastructure issue).

Is there currently a way to tell these two situations apart when using TryAcquireAsync?

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions