Skip to content

[BUG] ThreadPool keep-alive is 60 ms instead of 60 s in TencentCLS and AliyunSls log clients #6885

Description

@Aias00

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions