apache / apache/shenyu

[BUG] — `LoggingServerHttpResponse`: `new KeyWordMatch(...)` per response across ALL async-logging plugins

Open
#6,803 1 comment 0 reactions 0 assignees View on GitHub
priority: medium type: performance
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

- severity: Medium
- files: `shenyu-plugin-logging/shenyu-plugin-logging-common/.../body/LoggingServerHttpResponse.java:97` (constructor builds `KeyWordMatch` → `Pattern.compile`), constructed in `AbstractLoggingPlugin.doExecute` (kafka/rocketmq/pulsar/rabbitmq/clickhouse/elasticsearch/huawei-lts)
- description: A fresh `KeyWordMatch` is built for every response whenever desensitization keywords are configured, across all async-logging plugins.
- impact: Per-response regex compile across the entire logging-plugin family.
- suggested_fix: Build the `KeyWordMatch` once per rule-handle and reuse; pass the compiled matcher into the response decorator.
- confidence: High

---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with shenyu-plugin-logging/shenyu-plugin-logging-common/.../body/LoggingServerHttpResponse.java:97 and trace construction from AbstractLoggingPlugin.doExecute across the Kafka, RocketMQ, Pulsar, RabbitMQ, ClickHouse, Elasticsearch, and Huawei LTS plugins. Confirm how each rule handle creates the response decorator. Done means one compiled KeyWordMatch is reused per rule handle instead of compiling a pattern for every response.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.