Implementing Distributed Locks with Redis in Java Spring Applications
In a Spring Boot单体应用, standard locking mechanisms work well within a single JVM. How ever, when deploying to a Spring Cloud微服务集群 enviroment, these traditional locks become insufficient since multiple service instances can execute the same scheduled task simultaneously.
A practical scenario involves microservices using Spring's @Schedul ...
Posted on Sun, 06 Sep 2026 16:47:46 +0000 by phpcoder24july
Concurrency Edge Cases: Thread Pool Saturation and Transaction-Lock Semantics
Scenario 1: Unpredictable Thread Pool Rejection in Batch Processing
Developers often combine thread pools with coordination utilities like CountDownLatch to process data in chunks. On the surface, the implementation appears flawless. However, under specific conditions, this pattern can trigger intermittent RejectedExecutionException errors, baf ...
Posted on Sun, 16 Aug 2026 16:07:35 +0000 by tazz
Redis Distributed Lock Failures During Master-Slave Failover and Mitigation Strategies
Redis Lock Vulnearbility Analysis
Asynchronous replication creates critical vulnerabilities during failover scenarios:
Timeline:
1. Client A acquires lock on master (SET resource_id unique_val NX EX 30)
2. Lock replication to replica delayed (ms to hundreds of ms)
3. Master fails, sentinel triggers failover (3-10 seconds)
4. Replica becomes new ...
Posted on Mon, 25 May 2026 19:45:58 +0000 by 182x