You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "Aias00 (via GitHub)" <gi...@apache.org> on 2026/08/03 00:50:10 UTC

[I] [BUG] Removed ext-lib plugin never unregistered from the plugin chain [shenyu]

Aias00 opened a new issue, #6630:
URL: https://github.com/apache/shenyu/issues/6630

   - Severity: High
   - Location:
   `shenyu-web/src/main/java/org/apache/shenyu/web/handler/ShenyuWebHandler.java:150-191` (`putExtPlugins` — only add/update, no removal); `shenyu-web/src/main/java/org/apache/shenyu/web/loader/ShenyuExtPathPluginJarLoader.java:62-65` (calls `removePluginClassLoader` only); `shenyu-web/src/main/java/org/apache/shenyu/web/loader/ShenyuLoaderService.java:104-112`
   - 
   Description:
   When an ext-lib jar is deleted from disk, `ShenyuExtPathPluginJarLoader.loadExtendPlugins` calls `ShenyuPluginClassLoaderHolder.removePluginClassLoader(removePath)`, which closes the classloader and `destroySingleton`s its Spring beans. However, `ShenyuLoaderService.loaderPlugins` only calls `webHandler.putExtPlugins(newPlugins)` — and `putExtPlugins` has add and update branches but **no removal branch**. Plugin removal from the live `plugins`/`sourcePlugins` lists is only reachable via `PluginHandlerEvent` (DELETE → `onPluginRemoved`), which the ext-lib scan never publishes.
   - 
   Impact:
   The stale `ShenyuPlugin` instance from the destroyed classloader stays in `ShenyuWebHandler.plugins`. The next request dispatching to that plugin hits beans whose singletons were just `destroySingleton`'d and a classloader that was `close()`'d → `BeanCreationException`/`NoClassDefFoundError`/NPE for the whole route.
   - 
   Suggested fix:
   Have `loadExtendPlugins` return the removed plugin names; have `ShenyuLoaderService` call a new `webHandler.removeExtPlugins(names)` that filters `plugins`/`sourcePlugins` by `named()` (copy-on-write).
   - 
   Confidence: High
   - Related existing: WEB-08 covers a race in `sourcePlugins` construction, not the missing removal path.
   
   ---
   _Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] Removed ext-lib plugin never unregistered from the plugin chain [shenyu]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6630:
URL: https://github.com/apache/shenyu/issues/6630#issuecomment-5161207701

   👋 Hello @Aias00
   
   A new issue has been opened by @Aias00:
   - **Title**: [BUG] Removed ext-lib plugin never unregistered from the plugin chain
   - **Link**: https://github.com/apache/shenyu/issues/6630
   
   Please review when you have time. Thank you! 🙏


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] Removed ext-lib plugin never unregistered from the plugin chain [shenyu]

Posted by "Aias00 (via GitHub)" <gi...@apache.org>.
Aias00 closed issue #6630: [BUG] Removed ext-lib plugin never unregistered from the plugin chain
URL: https://github.com/apache/shenyu/issues/6630


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org