apache / apache/shenyu

[BUG] — `ComposableSignService.skipSignExchange`: 3× `String.format` per signed request

Open Beginner friendly
#6,804 1 comment 0 reactions 0 assignees View on GitHub
plugin: sign 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-security/shenyu-plugin-sign/.../service/ComposableSignService.java:234-236` (`String.format("%s-%s", PluginEnum.X.getName(), context.getRpcType())` inside `skipSignExchange`, invoked from `handleExchange` on every sign-enabled request)
- description: Three `String.format` calls (Formatter + StringBuilder + boxing) per signed request, when the module strings are static constants.
- impact: Per-signed-request allocation/boxing churn.
- suggested_fix: Precompute `private static final String SPRING_CLOUD_MODULE = PluginEnum.SPRING_CLOUD.getName() + "-" + ...` constants, or compare enum names directly without formatting.
- 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 in shenyu-plugin-security/shenyu-plugin-sign/.../service/ComposableSignService.java at skipSignExchange and its call from handleExchange. Check the existing security-plugin tests before changing the three formatted module strings. Done means signed-request behavior is unchanged while the per-request String.format and related allocation are removed; run the module tests afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.