You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you have many semaphore instances with the same key, only the one that called lock knows that the semaphore is locked, but all of them should find the correct state with locked?. Example of the faulty behavior:
[1]pry(main)> redis_sema=Redis::Semaphore.new(:my_sema)=>#<Redis::Semaphore:0x007fc6d8c8aae0@expiration=nil,@name=:my_sema,@redis=#<Redis client v3.3.0 for redis://127.0.0.1:6379/0>,@resource_count=1,@stale_client_timeout=nil,@tokens=[],@use_local_time=nil>
[2]pry(main)> redis_sema.lock=>"0"[3]pry(main)> redis_sema2=Redis::Semaphore.new(:my_sema)=>#<Redis::Semaphore:0x007fc6d8b480d8@expiration=nil,@name=:my_sema2,@redis=#<Redis client v3.3.0 for redis://127.0.0.1:6379/0>,@resource_count=1,@stale_client_timeout=nil,@tokens=[],@use_local_time=nil>
[4]pry(main)> redis_sema2.locked?=>false[5]pry(main)> redis_sema.locked?=>true
The text was updated successfully, but these errors were encountered:
When you have many semaphore instances with the same key, only the one that called
lock
knows that the semaphore is locked, but all of them should find the correct state withlocked?
. Example of the faulty behavior:The text was updated successfully, but these errors were encountered: