Aias00 opened a new issue, #7560: URL: https://github.com/apache/shenyu/issues/7560
### Feature Request Add gateway-configurable execution deadlines, cancellation, and guest memory budgets to wasm-api/wasm-base. ### Is your feature request related to a problem? Please describe [Request execution](https://github.com/apache/shenyu/blob/2dff2730ff399635b2bc657e21a903f391fb9df8/shenyu-plugin/shenyu-plugin-wasm-base/src/main/java/org/apache/shenyu/plugin/wasm/base/AbstractShenyuWasmPlugin.java#L129) and data-handler callbacks synchronously call ExportFunction.apply with no deadline or execution isolation. An erroneous infinite loop or expensive guest operation can hold the caller thread indefinitely. Chicory 1.7.3 checks thread interruption in relevant execution paths, but ShenYu does not arrange deadline-triggered interruption. Merely timing out a downstream reactive result would not prove that the synchronous guest stopped. Memory already has module-declared/runtime limits; this is a request for a configurable ShenYu budget, not a claim that Chicory memory is unbounded. [WasmLoader instance construction](https://github.com/apache/shenyu/blob/2dff2730ff399635b2bc657e21a903f391fb9df8/shenyu-plugin/shenyu-plugin-wasm-api/src/main/java/org/apache/shenyu/plugin/wasm/api/loader/WasmLoader.java#L122) currently does not configure a plugin-specific memory limit. ### Describe the solution you'd like - Define configurable execution deadlines and plugin memory limits. - Execute guest work in a context where timeout/cancellation can stop it without occupying gateway request threads indefinitely. - Apply limits consistently to compiler, interpreter, initialization and callbacks. - Define observable timeout/trap behavior and the disposition of an interrupted instance. - Test an infinite-loop guest, memory growth beyond the configured budget, argument cleanup, and successful subsequent requests. The mechanism should account for the actual interruption guarantees of the selected runtime and host functions. ### Describe alternatives you've considered Keep limits disabled for trusted deployments while documenting that choice. An ordinary reactive timeout around the current eager synchronous call is insufficient. ### Additional context ShenYu: `2.7.2-SNAPSHOT`, commit `2dff2730ff399635b2bc657e21a903f391fb9df8`; Java 17; Chicory 1.7.3. Existing 24 module tests pass but do not exercise execution limits. -- 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]
