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

   ### Is there an existing issue for this?
   
   - [x] I have searched the existing issues
   
   ### Current Behavior
   
   
[AbstractWasmPluginDataHandler](https://github.com/apache/shenyu/blob/2dff2730ff399635b2bc657e21a903f391fb9df8/shenyu-plugin/shenyu-plugin-wasm-base/src/main/java/org/apache/shenyu/plugin/wasm/base/handler/AbstractWasmPluginDataHandler.java#L35)
 stores PluginData, SelectorData and RuleData in static maps keyed only by a 
Long. All three [default ID 
generators](https://github.com/apache/shenyu/blob/2dff2730ff399635b2bc657e21a903f391fb9df8/shenyu-plugin/shenyu-plugin-wasm-base/src/main/java/org/apache/shenyu/plugin/wasm/base/handler/AbstractWasmPluginDataHandler.java#L131)
 return `0L`.
   
   Overlapping callbacks of the same data type can overwrite the same entry. 
When the first callback finishes, its unconditional `remove(id)` can remove the 
second callback's live argument.
   
   Other WASM base classes also use static argument maps. Independent 
subclass/instance counters can therefore collide even when each counter is 
locally unique.
   
   ### Expected Behavior
   
   Argument IDs should be generated safely by the infrastructure or have a 
clearly enforced uniqueness contract. Scope argument storage to the relevant 
instance where possible, and ensure cleanup cannot remove another invocation's 
entry.
   
   ### Steps To Reproduce
   
   The following is a source-derived interleaving, not a completed load-test 
result:
   1. Use a PluginDataHandler subclass without overriding the default ID 
generator.
   2. Start callback A with PluginData A and pause its guest/host call.
   3. Start callback B with PluginData B; both IDs are 0, so B overwrites A.
   4. Resume A: its host lookup can observe B, and its finally block removes 
B's entry.
   
   The same collision can occur across two handlers sharing a static map and 
generating identical instance-local IDs.
   
   ### Environment
   
   ShenYu: `2.7.2-SNAPSHOT`, commit `2dff2730ff399635b2bc657e21a903f391fb9df8`; 
Java 17; Chicory 1.7.3.
   
   ### Anything else?
   
   Test subclasses override ID generation with AtomicLong, so they do not cover 
default-ID collisions. Add deterministic overlapping-call and cross-instance 
regression tests. Fixing this alone does not resolve shared Chicory instance 
concurrency.
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to