apache / apache/shenyu

[BUG] Replaced ext-lib JAR is never reloaded (version check is dead code)

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

Description

- Severity: Medium-High
- Location:
`shenyu-web/src/main/java/org/apache/shenyu/web/loader/ShenyuExtPathPluginJarLoader.java:54-56` (`if (pluginJarName.contains(absolutePath)) { continue; }`); `shenyu-web/src/main/java/org/apache/shenyu/web/loader/ShenyuPluginClassLoader.java:212-219` (`compareVersion` — zero call sites)
-
Description:
`loadExtendPlugins` keys only on the file's absolute path. If the path is already known, the jar is silently skipped — content/version is never re-examined. `ShenyuPluginClassLoader.compareVersion(...)` would detect a version change but has zero call sites.
-
Impact:
Operator replaces `ext-lib/foo.jar` with a new build (same filename) and expects hot reload. The scheduler rescans, sees the path known, silently ignores. Gateway keeps running the old plugin indefinitely. Only delete-then-re-add triggers reload.
-
Suggested fix:
Track `(path, version)` or `(path, lastModified/hash)`; when path exists but version differs, `removePluginClassLoader(path)` and re-parse. Wire `compareVersion` into this check.
-
Confidence: High
- Related existing: none

---
_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-web/src/main/java/org/apache/shenyu/web/loader/ShenyuExtPathPluginJarLoader.java at loadExtendPlugins and inspect the path-based skip at lines 54-56. Then read compareVersion in ShenyuPluginClassLoader.java:212-219 and trace how the scheduler rescans ext-lib. Done means replacing a JAR at the same path is detected and the updated plugin is reloaded without deleting the file first.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.