This article explains why using the forceful kill -9 command to terminate Spring Boot services can cause data inconsistency and errors, and demonstrates three safer shutdown methods—using kill -15, invoking ConfigurableApplicationContext.close(), and leveraging Spring Boot Actuator—complete with code examples and configuration steps.
This article explains the dangers of using the kill -9 command on Java services, illustrates how it can cause data loss, and presents several graceful shutdown techniques for Spring Boot—including SIGTERM, Actuator endpoints, custom Tomcat shutdown hooks, and @PreDestroy backups—complete with code examples and screenshots.
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.
In a late-night deployment, the author traced a persistent ‘DataSource already closed’ error to an ungraceful RocketMQ consumer shutdown, explored Spring’s ShutdownHook behavior, and ultimately implemented a SmartLifecycle-based solution for orderly bean destruction.
Learn five practical ways to gracefully shut down a Spring Boot application—including using Actuator’s shutdown endpoint, closing the application context, PID file handling, SpringApplication.exit, and a custom shutdown controller—so unfinished tasks finish, logs flush, and services stop safely without resorting to kill‑9.
This article explains how to achieve graceful shutdown for Dubbo services by leveraging operating‑system signals, Docker commands, JVM shutdown hooks, Spring event mechanisms, and Dubbo's own extensions, illustrating each layer with code examples and best‑practice recommendations.
This article explains how the Linux kill -9 command can cause data loss and service instability, demonstrates safer alternatives such as kill -15 and Spring Boot's built‑in shutdown mechanisms, and provides code examples for implementing graceful termination, custom shutdown hooks, and pre‑destroy data backup in Java backend services.
This article explains the dangers of using the Linux kill -9 command for terminating processes, illustrates how abrupt termination can cause data inconsistency in transactional systems, and provides step‑by‑step methods—including Spring Boot actuator, custom Tomcat shutdown, and @PreDestroy hooks—to achieve graceful service shutdown.
This article explains the risks of using the Linux kill -9 command to terminate Spring Boot applications, demonstrates how it can cause data inconsistency and thread interruptions, and provides several graceful shutdown techniques—including SIGTERM, Spring's ConfigurableApplicationContext, Actuator endpoints, and custom Tomcat shutdown hooks—to safely stop services and optionally perform data backup.
This article explains why using the forceful kill -9 command to stop Linux processes can cause data loss and inconsistent states, especially in distributed systems, and demonstrates several graceful shutdown methods for Spring Boot—including SIGTERM, ConfigurableApplicationContext.close(), Actuator shutdown endpoints, custom Tomcat connector handling, and @PreDestroy data‑backup hooks—complete with code examples and execution logs.
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.
This article explains how Spring Boot 2.3.4 implements graceful shutdown for Jetty, Reactor Netty, Tomcat and Undertow, shows the simple YAML configuration, demonstrates code examples using DisposableBean and @PreDestroy, and describes the actuator shutdown endpoint and its relevance to Kubernetes liveness and readiness probes.
This article explains the concept of graceful shutdown for Java services, demonstrates how to register shutdown hooks with Runtime.getRuntime().addShutdownHook, provides a complete code example using thread pools, shows the execution results, and discusses best practices for safely terminating applications.
This article explains how to implement graceful up‑ and down‑scaling for Spring Cloud applications running on Kubernetes, covering design principles, signal handling, resource cleanup, Spring Boot configuration, multiple deployment scenarios, and integration with Kubernetes health probes to ensure lossless traffic flow.
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.
This article explains the true meaning of the Linux kill command, the differences between signals like SIGTERM and SIGKILL, the risks of using kill -9 for abrupt termination, and how to implement graceful shutdowns in Java and shell scripts.
The article explains the semantics of the Linux kill command, why using kill -9 for abrupt termination is risky, how to prefer SIGTERM (kill -15) for graceful shutdowns, shows Java shutdown‑hook usage, and provides a shell script that automates safe process termination.
This article explains how Spring Boot 2.3 provides built‑in graceful shutdown for embedded web servers, how to enable it with configuration, the role of the Shutdown enum and timeout settings, and additional techniques such as Actuator endpoints and signal handling to ensure safe application termination.
This article explains how to enable and use Spring Boot's graceful shutdown feature in version 2.3, including configuration of the embedded web server and Actuator, and also provides a custom solution for older Spring Boot releases to achieve smooth termination of ongoing requests.
This article explains why graceful shutdown is essential for Spring Boot and Spring Cloud applications, outlines key precautions, shows how Spring Boot 2.3 adds built‑in support, and provides configuration steps, code examples, and container‑specific behaviors to ensure clean service termination.
This article explains how Spring Boot 2.3 implements graceful shutdown, showing configuration properties, code examples, container-specific behaviors, and how to trigger shutdown via the actuator endpoint, while also noting differences among Tomcat, Reactor Netty, and Undertow.
Learn how Spring Boot 2.3’s built-in graceful shutdown works, configure it with server.shutdown=graceful, understand shutdown phases, timeout settings, and see code examples for handling shutdown hooks and actuator endpoints, ensuring active requests finish without data inconsistency across Tomcat, Jetty, Netty, and Undertow.
This article outlines a step‑by‑step procedure for safely taking an Elasticsearch node offline—checking master‑eligible settings, adjusting minimum_master_nodes, excluding the node from routing, waiting for shard relocation, stopping the service, and restoring the cluster routing—ensuring no data loss or service interruption.
This article explains why graceful shutdown is important for Spring Boot services and demonstrates five practical methods—including Actuator shutdown, context closing, PID file handling, SpringApplication.exit, and a custom controller—each with complete code examples and usage instructions.
This article explores Dubbo's graceful shutdown mechanisms across versions 2.5.x, 2.6.x, and 2.7.x, detailing the underlying shutdown hooks, registry and protocol cleanup, Spring integration challenges, and best‑practice configurations to ensure in‑flight requests complete without service disruption.
Learn how to implement a smooth, graceful shutdown for Spring Boot applications that use an embedded Tomcat server by customizing the Tomcat connector, enabling the Actuator shutdown endpoint, and automating the process with scripts, ensuring in‑flight requests complete before the service stops.
This article explains how Node.js determines when to exit by tracking all asynchronous operations, outlines common async handles that keep the process alive, and shows how to use built‑in methods and the "why‑is‑node‑running" library to diagnose and implement graceful shutdowns.
This article explains the difference between kill -9 and kill -15 signals, how Spring Boot processes the TERM signal, and provides practical code examples for implementing graceful shutdown, including shutdown hooks, DisposableBean, and proper thread‑pool termination strategies.
This article explains why asynchronous @Async tasks using a custom ThreadPoolTaskScheduler can fail during application shutdown due to premature Redis connection pool destruction, and provides a step‑by‑step solution using Spring's shutdown configuration to wait for tasks to complete before closing resources.
Graceful application shutdown prevents blocked requests, accidental data writes, and operation failures by releasing resources, closing database connections, and handling SIGTERM signals, and this article outlines a practical step-by-step process—including load balancer coordination and sample Node.js code—to ensure clean termination.
This article explains how to build a robust multi‑process Node.js server using the cluster module, covering round‑robin load balancing, graceful worker shutdown, process monitoring, and inter‑process communication with code examples for both master and worker processes.