From 4f6528fb86a843b2308167ffd1e5faac22e33a4b Mon Sep 17 00:00:00 2001 From: GuoHao Date: Thu, 16 Mar 2023 10:23:19 +0800 Subject: [PATCH] Call onClose() when deser error (#11838) --- .../dubbo/rpc/protocol/tri/call/TripleClientCall.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java index a7d5e39d80..4ee3512adf 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java @@ -74,8 +74,10 @@ public class TripleClientCall implements ClientCall, ClientStream.Listener { final Object unpacked = requestMetadata.packableMethod.parseResponse(message); listener.onMessage(unpacked); } catch (Throwable t) { - cancelByLocal(TriRpcStatus.INTERNAL.withDescription("Deserialize response failed") - .withCause(t).asException()); + TriRpcStatus status = TriRpcStatus.INTERNAL.withDescription("Deserialize response failed") + .withCause(t); + cancelByLocal(status.asException()); + listener.onClose(status,null); LOGGER.error(PROTOCOL_FAILED_RESPONSE, "", "", String.format("Failed to deserialize triple response, service=%s, method=%s,connection=%s", connection, requestMetadata.service, requestMetadata.method.getMethodName()), t); }