Description
initClient0 registers Runtime.getRuntime().addShutdownHook(new Thread(this::close)) in addition to the base-class hook tracked/removed by AbstractLogConsumeClient. On every reconfig, only the base-class hook is removed; the RocketMQ-added hook is never removed and accumulates. At JVM shutdown close() is invoked once per leaked hook.
Location
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-rocketmq/src/main/java/org/apache/shenyu/plugin/logging/rocketmq/client/RocketMQLogCollectClient.java:83
Impact
Shutdown-hook leak across config refreshes; close0 (producer.shutdown()) called multiple times at shutdown; hook threads accumulate.
Suggested fix
Remove the extra addShutdownHook; rely on the base-class tracked hook, or track/remove this hook in close0.
Related existing
Distinct from #6768 (Pulsar shutdown-hook, LOG-11) — same pattern, different file.
Description
initClient0registersRuntime.getRuntime().addShutdownHook(new Thread(this::close))in addition to the base-class hook tracked/removed byAbstractLogConsumeClient. On every reconfig, only the base-class hook is removed; the RocketMQ-added hook is never removed and accumulates. At JVM shutdownclose()is invoked once per leaked hook.Location
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-rocketmq/src/main/java/org/apache/shenyu/plugin/logging/rocketmq/client/RocketMQLogCollectClient.java:83Impact
Shutdown-hook leak across config refreshes;
close0(producer.shutdown()) called multiple times at shutdown; hook threads accumulate.Suggested fix
Remove the extra
addShutdownHook; rely on the base-class tracked hook, or track/remove this hook inclose0.Related existing
Distinct from #6768 (Pulsar shutdown-hook, LOG-11) — same pattern, different file.