Comments (7)
Fixed. Thanks for report
from redisson.
A variation on the example given above is:
RedissonClient redisson = Redisson.create(config);
RLock lock = redisson.getLock("test-lock:1");
lock.lock(10, TimeUnit.SECONDS);
Thread.sleep(5000);
lock.lock(10, TimeUnit.SECONDS);
lock.unlock();
System.out.println(lock.remainTimeToLive());
Should the remainTimeToLive be 10 seconds or 5 seconds?
Another one:
RedissonClient redisson = Redisson.create(config);
RLock lock = redisson.getLock("test-lock:1");
lock.lock(10, TimeUnit.SECONDS);
lock.lock(5, TimeUnit.SECONDS);
lock.unlock();
System.out.println(lock.remainTimeToLive());
Should the remainTimeToLive be 10 seconds or 5 seconds?
from redisson.
Hi @mrniko, do you know if there is some plan to fix this in a next patch version? Or is there something I can do to help?
from redisson.
A variation on the example given above is:
RedissonClient redisson = Redisson.create(config); RLock lock = redisson.getLock("test-lock:1"); lock.lock(10, TimeUnit.SECONDS); Thread.sleep(5000); lock.lock(10, TimeUnit.SECONDS); lock.unlock(); System.out.println(lock.remainTimeToLive());Should the remainTimeToLive be 10 seconds or 5 seconds?
Another one:
RedissonClient redisson = Redisson.create(config); RLock lock = redisson.getLock("test-lock:1"); lock.lock(10, TimeUnit.SECONDS); lock.lock(5, TimeUnit.SECONDS); lock.unlock(); System.out.println(lock.remainTimeToLive());Should the remainTimeToLive be 10 seconds or 5 seconds?
first example is about 10 seconds. Second example is about 5 seconds. I have checked your examples. Results are correct.
from redisson.
I have checked your examples. Results are correct.
Ok, so you didn't reproduce the problem I was experiencing where lock, lock, unlock would result with a time to live to be the default 30seconds instead?
I will check again with latest version and close this if it's all good. Thank you for looking into it.
from redisson.
So, yes, indeed, it works as expected, so I'm not sure what happens in my particular environment (because I have built abstractions on top of Redisson and I had tests that are now failing with 3.19.2+).
I will close this ticket then and reopen one if needed. Sorry again for the noise :)
from redisson.
Well, that was fast, actually the bug is really there, the repro is the same as in the description but with a twist:
RedissonClient redisson = Redisson.create(config);
RLock lock = redisson.getLock("test-lock:1");
lock.lock(10, TimeUnit.SECONDS);
lock.lock(10, TimeUnit.SECONDS);
lock.lock(10, TimeUnit.SECONDS);
lock.unlock();
lock.unlock();
System.out.println(lock.remainTimeToLive()); // prints something close to the config default of 30 000
from redisson.
Related Issues (20)
- Name mapper behavior in context of Redis operation which takes additional key parameter
- Settings into application.properties file. HOT 1
- Redisson needs to support chaining BITFIELD increment commands HOT 2
- Command still hasn't been written into connection! Increase nettyThreads and/or retryInterval settings. HOT 3
- Issue related to redis and redisson HOT 1
- redisson 3.32.0 let my services CPU upto 100% HOT 1
- Shutting down Redisson client much slower since 3.30.0 HOT 5
- Reactive API usage unclear for unlocking HOT 2
- ClusterConnectionManager NPE HOT 8
- r.getJsonBucket(JsonBucketOptions options) does not return RJsonBucket with specified timeout/retryAttempts/retryInterval
- NullPointerException in ClusterConnectionManager HOT 4
- Tomcat Session Manager: CROSSSLOT Keys in request don't hash to the same slot HOT 3
- NPEs Continuing in Redisson Tomcat Logs HOT 1
- Add copy() and copyAndReplace() methods to RObject HOT 1
- RObject.rename() method doesn't work in cluster HOT 1
- Add RCountDownLatch.countDownAndAwait() method.
- Redisson does not recover from DNS failures on master resolution for single-shard clusters HOT 7
- Are RMap `getMap`, `putAll`, `put`, `remove` operations atomic & threadsafe? HOT 3
- about org.redisson.client.protocol.CommandData ask
- Attempt to fully sync to 'CLUSTER NODES' after some timeout where the cluster is not healthy from the client perspective HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redisson.