Aias00 opened a new issue, #8020: URL: https://github.com/apache/shenyu/issues/8020
### Is there an existing issue for this? - [x] I have searched the existing issues. ### Current Behavior ShenyuGrpcClient.call attaches a cancellation hook that cancels the ListenableFuture returned by invoke(). invoke() returns CompleteObserver's independent SettableFuture. That future has no cancellation listener connected to the ClientCall created in invoke(), so cancelling the gateway result does not call ClientCall.cancel(). MessageWriter has a call reference for aggregate-budget overflow, but that is a different cancellation path. The existing cancellation test replaces invoke() with a mocked future and checks only that future's cancelled flag. Suggested severity: Medium: abandoned upstream work and response aggregation can continue after downstream cancellation. ### Expected Behavior Cancelling the returned CompletableFuture (including Reactor cancellation on disconnect) must propagate to the actual gRPC ClientCall and stop the server-side stream/work as far as the transport supports. Cancellation should be idempotent and safe against concurrent normal completion and aggregate overflow. ### Steps To Reproduce 1. Start an in-process or fake-channel server-streaming call that remains active and records cancellation. 2. Invoke the real ShenyuGrpcClient.call()/invoke() path rather than mocking invoke(). 3. Cancel the returned CompletableFuture or cancel the subscribing gateway request. 4. Assert that ClientCall.cancel() and the server cancellation signal are observed promptly. By inspection, current code only cancels CompleteObserver's SettableFuture; the call continues until completion, deadline or a separate aggregate-budget overflow. This scenario has not been run in the reporting environment. ### Environment - ShenYu: master / 2.7.2-SNAPSHOT, commit `34f2ed036747936a5e28aea2c94cd9b3cddcce47`. - Evidence: source inspection. The reporting environment has no available Java runtime, so no Maven/JUnit execution or live reproduction is claimed. - These issues concern existing runtime behavior, not the proposed plugin DAG implementation. ### Debug logs No runtime logs captured; this report is based on the source paths below. ### Code evidence - [Result cancellation and underlying call creation](https://github.com/apache/shenyu/blob/34f2ed036747936a5e28aea2c94cd9b3cddcce47/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-grpc/src/main/java/org/apache/shenyu/plugin/grpc/client/ShenyuGrpcClient.java#L124-L161) - [Standalone SettableFuture with no transport cancellation hook](https://github.com/apache/shenyu/blob/34f2ed036747936a5e28aea2c94cd9b3cddcce47/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-grpc/src/main/java/org/apache/shenyu/plugin/grpc/proto/CompleteObserver.java) - [Overflow-only ClientCall cancellation](https://github.com/apache/shenyu/blob/34f2ed036747936a5e28aea2c94cd9b3cddcce47/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-grpc/src/main/java/org/apache/shenyu/plugin/grpc/proto/MessageWriter.java) - [Existing test mocks invoke and only checks invocation future cancellation](https://github.com/apache/shenyu/blob/34f2ed036747936a5e28aea2c94cd9b3cddcce47/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-grpc/src/test/java/org/apache/shenyu/plugin/grpc/client/ShenyuGrpcClientTest.java#L69-L85) ### Suggested fix direction Bind invocation-future cancellation to the actual ClientCall, or represent both through a shared invocation lifecycle object. Ensure the returned result and Reactor cancellation reach that same object; aggregate overflow and downstream cancellation should use one idempotent transport cleanup path. ### Acceptance criteria - Verify real ClientCall cancellation, not just a mocked future flag. - Cover cancellation before the first response and during server streaming, plus unary calls. - Normal completion and error behavior remain correct; cancellation/completion races do not double-clean resources. - Existing aggregate count/byte overflow cancellation continues to work. ### Related work Related to the lifecycle covered around #7928 / #7940, but distinct from aggregate-budget overflow and outbound readiness #7927. -- 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]
