Tagged articles
ShutdownHook
11 articles · Page 1 of 1
This article explains the concept of Java's Runtime.addShutdownHook, details its underlying implementation in the Runtime and ApplicationShutdownHooks classes, demonstrates usage with code examples, discusses typical application scenarios, potential risks of long‑running hooks, and provides best‑practice recommendations for safe JVM shutdown handling.
JVMJavaShutdownHook
0 likes · 7 min read

This article explains the purpose and inner workings of Java's Runtime.addShutdownHook, walks through the Runtime and ApplicationShutdownHooks source code, demonstrates practical usage with examples, discusses common scenarios, potential risks, and best‑practice solutions for reliable resource cleanup during JVM shutdown.
BackendJVMShutdownHook
0 likes · 9 min read

This article demonstrates practical ways to leverage Java's ShutdownHook API for task statistics, connection cleanup, handling JVM abnormal exits, and persisting state during performance testing, providing code examples, pitfalls of daemon threads, and strategies for reliable resource management in backend applications.
BackendJVMJava
0 likes · 8 min read

This article explains the Java Runtime addShutdownHook API, its purpose for registering shutdown hooks, typical use cases such as resource cleanup, state saving, and logging, and provides practical Java and Groovy code examples while noting that hook execution order is unspecified.
GroovyJavaShutdownHook
0 likes · 6 min read

The article explains the three JVM shutdown approaches—normal, forced, and abnormal—details how to use ShutdownHook and custom SignalHandler for handling termination signals, outlines best practices for graceful shutdown, and provides example scripts and references.
GracefulShutdownJVMJava
0 likes · 6 min read

This guide explains why graceful shutdown matters for Java services, describes the three JVM termination scenarios, demonstrates normal, abnormal, and forced shutdowns with code, and provides best‑practice rules and real‑world examples such as Spring integration and custom signal handling.
JVMShutdownHookSpring
0 likes · 11 min read

The article recounts a production incident caused by an ungraceful RocketMQ consumer shutdown, analyzes the root cause involving Spring's bean destruction order and ShutdownHook behavior, and presents two solutions—using the official Spring‑Boot starter with SmartLifecycle or handling ContextClosedEvent—to achieve orderly termination.
BackendRocketMQShutdownHook
0 likes · 5 min read

This article investigates the duplicate unregister bug in Dubbo 2.7.3, explains how the shutdown hook interaction causes the error, and shows how the issue was fixed in later versions and can be mitigated without upgrading the whole framework.
DubboDuplicate UnregisterJava
0 likes · 8 min read

This article explains how to add and use Java's ShutdownHook, details its internal data structures and execution order, describes system‑level and application‑level hooks, outlines the trigger points such as Runtime.exit and signal handling, and provides code examples for implementing graceful shutdowns.
GracefulShutdownJVMJava
0 likes · 8 min read

This article explains the three JVM shutdown methods, how to use ShutdownHook and custom SignalHandler for cleanup, and outlines a step‑by‑step graceful restart process using kill -12, kill -15, and kill -9 signals, with sample scripts and references.
JVMJavaLinux signals
0 likes · 5 min read

This article explains why abrupt service restarts cause "Can not get connection to server" errors in Zookeeper‑based microservices and details a Java ShutdownHook solution that deregisters instances, processes in‑flight requests, and prevents client‑side failures during graceful shutdown.
JavaShutdownHookZooKeeper
0 likes · 8 min read
