cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to check if there's already a distributed lock in consul for particular lock name?

New Contributor

Is there a way to check if there's already a distributed lock in consul for particular lock name?

I'm trying to check if there's a distributed lock in consul for a particular lock name using consul client (https://www.nuget.org/packages/Consul/).

Currently the only way to achieve it is to try to acquire a lock for that lock name, using ConsulClient.AcquireLock(). However if the lock exists AcquireLock method doesn't return a result, but instead waits for the consul lock to be released and right then locks it and returns a result.

await new ConsulClient().AcquireLock("lockNameExample");

Is there a way to retrieve the list of all consul locks or maybe some other way to check if there's a lock in consul for the given lock name?

1 REPLY 1
Staff

Re: Is there a way to check if there's already a distributed lock in consul for particular lock name

Hi Rushab, a little lost on your exact question. I have a few questions - 

1) Are you currently using SmartBear LoadNinja? If yes, can you please share your username in our support channel - https://support.smartbear.com/message/?prod=loadninja

2) Is there a screenshot/video of exactly what you're trying to accompolish?  

 

New Here?
Join us and watch the welcome video:
Labels