the above junit test can reproduce this.
docker run -p 6379:6379 -d redis:7.0.12 --requirepass "mypass"# start this docker container before running the above junit test
If I run these 2 threads in 2 jvms, then the lease thread 2 can only get lock after lease time is past.But if I run them in the same jvm, then thread 2 can get lock before lease time is past.
Is this by design?