New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per lock timeout values do not appear to work #163
Comments
I'm not sure what to do here, as there are tests for this in the gem (I think). Any chance you have timeout code somewhere else that could be causing this? |
Not that I know of. The only timeout besides the lock is on the connection pool for redis which is 5 seconds (very similar setup to your example in the readme). I also played with different values and it seemed to stick with 5 seconds. I have code that is running in Rails Controllers, Resque Workers and Ruby Daemons and I have seen this error from the Workers and the Daemons but I don't recall seeing it in the controllers if that helps any. But I don't see how that would change anything. |
After a good amount of testing in production and staging we are still seeing
where service lock is defined as
So it would appear this issue is still occurring. |
On top of that we added a new lock to our code and often the lock is getting left behind in Redis. We are stuck on a slightly older version of Redis gem due to some dependencies (3.0.7) and we use RedisLabs MultiAZ cluster. Any thoughts? |
I'm definitely interested in root causing this and fixing it, but my time On Sat, Jul 11, 2015 at 4:21 PM, jdejong notifications@github.com wrote:
|
@theplastictoy were you able to resolve this issue? |
@byronalfonso no. We're migrating to a newer stack version, so in the meantime we're doing it differently. I would say this is a coincidence of old versions of redis-objects and rails. |
@theplastictoy I see.. Sounds like a good route to go to.. Thanks for the reply 👍 |
I think I might have finally figured out the issue. In cases where the class locks are using used, it doesn't seem like the options are reaching the Lock class from the Object:Lock class. The reason I think this is the issue is any class lock always sets the key's value to 1 but when I just the Lock class directly it sets the timestamp as expected. Do the service locks just not work? |
Can you see if redis-objects v1.4.3 just released to rubygems improves locking, for those of you still interested? |
CC @tmsrjs to potentially verify the tests are actually working |
I have the following lock defined in a class
I have also tried several other variations
for setting the lock up. However when I use the lock and I cause a collision that should block the second thread for 10-15 seconds I end up with the following error.
It seems like it is not taking the options I am passing into the lock and just using the default.
Not that I think it matters but this is how I am grabbing the lock
I am on Ruby 1.9.3p448, redis 3.0.7 and redis-objects 0.9.1.
Thanks in advance for any suggestions.
The text was updated successfully, but these errors were encountered: