madelson / DistributedLock

A .NET library for distributed synchronization
MIT License
1.86k stars 192 forks source link

Timeout exceeded when trying to acquire the lock #139

Closed Wx19880221 closed 2 years ago

Wx19880221 commented 2 years ago

Hi when I use 10 threads testing to get distribute lock. There occur error :Timeout exceeded when trying to acquire the lock. 1659921923889 I set timeout values to 1659921974099

madelson commented 2 years ago

@Wx19880221 thanks for your interest in the library!

I see that your timeout is only 6000000 ticks which is 0.6s which is pretty short Is it possible that with 10 threads doing various actions you are timing out legitimately? Perhaps you meant to do TimeSpan.FromSeconds or TimeSpan.FromMilliseconds?

Wx19880221 commented 2 years ago

Thanks a lot