Tagged articles
ScheduledExecutorService
21 articles · Page 1 of 1
The article analyzes a server outage triggered by a module that repeatedly created a scheduled task without proper lifecycle control, examines the problematic Java code, lists four key issues, presents a corrected implementation, and reflects on development, testing, review, and logging practices to prevent similar incidents.
BackendDebuggingLogging
0 likes · 5 min read

This article explains the concept and implementation of the time wheel in Dubbo, covering its use for scheduled retries, heartbeat handling, underlying HashedWheelTimer mechanics, configuration details, performance considerations, and related issues, providing a thorough guide for backend developers.
DubboFailbackHashedWheelTimer
0 likes · 22 min read

This article explains how to protect time‑consuming business operations and critical data by designing a Redis‑based distributed lock using custom annotations, Spring AOP, and a ScheduledExecutorService that automatically extends the lock’s expiration to avoid premature release.
ConcurrencyDistributed LockJava
0 likes · 11 min read

The article explains why using Thread.sleep in a loop causes busy‑waiting and performance problems, and demonstrates several Java scheduling alternatives—including Timer/TimerTask, ScheduledExecutorService, wait/notify, and CompletableFuture—to efficiently check a flag at fixed intervals.
CompletableFutureConcurrencyJava
0 likes · 9 min read

This article compares three single‑node scheduling approaches in Spring Boot—Java's legacy Timer, the modern ScheduledExecutorService, and Spring's @Scheduled annotation—showing their implementations, execution characteristics, thread handling, error behavior, and when to prefer each solution.
@ScheduledJava ConcurrencyScheduledExecutorService
0 likes · 19 min read

A mis‑handled exception in a ScheduledExecutorService can silently halt the entire scheduled thread pool, causing critical periodic jobs to stop; this article explains the underlying delay‑queue and thread‑pool mechanics, shows reproducible code, and provides practical safeguards to keep scheduled tasks alive.
DelayQueueExceptionHandlingJava
0 likes · 9 min read

This article walks through how to use the Singleton pattern together with SpringBoot's ScheduledExecutorService to build a reusable asynchronous task manager, recreate Ruoyi's login‑log recording logic, and verify the non‑blocking behavior with a concrete test case.
AsyncManagerAsyncTaskFactoryJava
0 likes · 7 min read

This article explains the concept of request merging for high‑concurrency web services, outlines its advantages and drawbacks, and provides a complete Java implementation using ScheduledExecutorService, a memory queue, and a generic BatchCollapser utility with usage examples.
BackendJavaScheduledExecutorService
0 likes · 8 min read

This article explains why time‑consuming business operations need a distributed lock, walks through using Redis as a lock with Spring AOP, details the lock‑acquire, timeout, and renewal mechanisms, provides full code examples, testing steps, and best‑practice recommendations for reliable concurrency control in Java back‑end services.
ConcurrencyDistributed LockJava
0 likes · 12 min read

This article walks through the design and implementation of a Redis‑based distributed lock for time‑consuming business operations, covering annotation creation, AOP pointcut setup, lock acquisition and release, timeout handling with a renewal thread, testing, and practical code examples.
AOPDistributed LockJava
0 likes · 12 min read

This article explains how a JDK bug in ScheduledExecutorService can cause a thread pool with coreSize 0 to enter a tight loop, driving CPU usage to 100 %, and shows the fixes introduced in JDK 9 as well as a related bug in scheduleWithFixedDelay.
CPU spikeJDK bugJava Concurrency
0 likes · 13 min read

This article explains how to protect time‑consuming business operations using a Redis‑based distributed lock, detailing the annotation design, AOP pointcut, lock acquisition and release, timeout handling, and a scheduled renewal mechanism with sample Java code.
Distributed LockJavaRedis
0 likes · 13 min read

This article explains how to design and implement a distributed lock using Redis, Spring AOP annotations, and a scheduled executor to automatically extend lock expiration, providing complete Java code examples, configuration details, testing procedures, and best‑practice recommendations for handling long‑running business operations safely.
AOPConcurrencyDistributed Lock
0 likes · 12 min read

This article explains how to implement a Redis-based distributed lock in Spring Boot using custom annotations, AOP interception, and a scheduled executor to automatically renew lock expiration, providing a complete design, code examples, and testing guidance for handling long-running operations safely.
ConcurrencyDistributed LockJava
0 likes · 12 min read

This article explains the design and implementation of a Redis‑based distributed lock using Spring AOP, covering annotation creation, pointcut definition, lock acquisition, automatic renewal via a scheduled thread pool, error handling, and testing to ensure safe concurrent access to critical business data.
ConcurrencyDistributed LockJava
0 likes · 13 min read

This article explains how to protect time‑consuming business operations by using Redis as a distributed lock together with Spring AOP, covering annotation design, aspect implementation, lock acquisition, automatic renewal via a scheduled executor, and practical testing examples.
AOPDistributed LockJava
0 likes · 15 min read

This article explains how to protect time‑consuming business operations in a Spring Boot application by creating a custom @RedisLock annotation, using Redis as a distributed lock via AOP, implementing automatic lock renewal with a ScheduledExecutorService, and handling lock release and thread interruption.
AOPDistributed LockJava
0 likes · 11 min read

This article compares Java's Timer and ScheduledExecutorService for scheduling tasks, explains their internal workings, demonstrates common pitfalls, and provides multiple code examples showing how to schedule one‑off, fixed‑rate, and fixed‑delay tasks using both Runnable and Callable.
ConcurrencyJavaScheduledExecutorService
0 likes · 8 min read

This article explains several ways to implement scheduled tasks in Java, covering the simple Timer class, the more robust ScheduledExecutorService, Spring's @Scheduled annotation, and distributed solutions using Redis ZSet and key‑space notifications, with code examples and practical considerations.
Distributed SchedulingJavaRedis
0 likes · 16 min read

This guide compares four Java scheduling options—Timer, ScheduledExecutorService, Spring Task, and Quartz—showing how to implement each in Spring Boot, configure cron expressions, enable async execution, and choose the right tool for your needs.
Cron ExpressionsQuartzScheduledExecutorService
0 likes · 12 min read

This article provides a thorough overview of Java task scheduling, covering the native Timer utility, the thread‑pool‑based ScheduledExecutorService, and the powerful Quartz framework, including their APIs, usage patterns, limitations, and integration with Spring for enterprise applications.
JavaQuartzScheduledExecutorService
0 likes · 8 min read
