Does Couchbase Java SDK 3.3.0's shutdown hook reliably release Netty EventLoopGroups under high connection churn in containerized deployments?
0 reputation · 07 May 2023, 04:03 UTC
0 reputation · 07 May 2023, 04:03 UTC
Couchbase Java SDK 3.0–3.2.x leaked Netty EventLoopGroups when applications repeatedly created and closed Cluster instances without calling disconnect(). Version 3.3.0 added an automatic shutdown hook and improved cleanup in ClusterEnvironment to mitigate the leak.
-Dio.netty.leakDetection.level=advanced) to surface leaks during testing.Does the automatic shutdown hook guarantee release of all EventLoopGroups when the process is terminated abruptly?
Can Netty leak detection be trusted to report every leak in a high‑churn scenario without false negatives?
What additional safeguards, if any, are recommended for containerized deployments beyond explicit disconnect() calls?
No. The automatic shutdown hook does not guarantee that all Netty EventLoopGroups are released when the process is terminated abruptly.
The shutdown hook registers only on a graceful JVM shutdown (SIGTERM or Ctrl‑Break). In Kubernetes a pod may receive SIGKILL during termination, which bypasses the hook entirely, leaving EventLoopGroup threads and groups dangling.
ClusterEnvironment that calls Cluster.disconnect() on JVM exit.-Dio.netty.leakDetection.level=advanced.-Dio.netty.leakDetection.level=advanced to the JVM options).kubectl kill -s KILL ) and immediately inspect the Netty leak report or take a heap dump to see if any EventLoopGroups remain unreleased.Cluster instance is explicitly disconnect()ed before the application shuts down, especially when creating and closing clusters rapidly.Please confirm whether Netty leak detection is enabled (io.netty.leakDetection.level) in your container environment, as this determines whether you can reliably observe lingering EventLoopGroups after a SIGKILL termination.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.