You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by ea...@apache.org on 2022/04/16 01:12:45 UTC
[dubbo] branch 3.0 updated: Add log when serialize failed (#9929)
This is an automated email from the ASF dual-hosted git repository.
earthchen pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 868c02cbc3 Add log when serialize failed (#9929)
868c02cbc3 is described below
commit 868c02cbc3d1f85a92b0cdc1a98ad49372228a23
Author: GuoHao <gu...@gmail.com>
AuthorDate: Sat Apr 16 09:12:22 2022 +0800
Add log when serialize failed (#9929)
---
.../org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCall.java | 4 +++-
.../org/apache/dubbo/rpc/protocol/tri/call/TripleClientCall.java | 6 ++++--
.../apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java | 1 -
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCall.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCall.java
index e742f57680..1a2c31611d 100644
--- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCall.java
+++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/call/AbstractServerCall.java
@@ -138,9 +138,11 @@ public abstract class AbstractServerCall implements ServerCall, ServerStream.Lis
final byte[] data;
try {
data = packableMethod.packResponse(message);
- } catch (IOException e) {
+ } catch (Throwable e) {
close(TriRpcStatus.INTERNAL.withDescription("Serialize response failed")
.withCause(e), null);
+ LOGGER.error(String.format("Serialize triple response failed, service=%s method=%s",
+ serviceName, methodName), e);
return;
}
if (data == null) {
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 f3003efd69..77665a327e 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
@@ -80,9 +80,11 @@ public class TripleClientCall implements ClientCall, ClientStream.Listener {
try {
final Object unpacked = requestMetadata.packableMethod.parseResponse(message);
listener.onMessage(unpacked);
- } catch (IOException | ClassNotFoundException e) {
+ } catch (Throwable t) {
cancelByLocal(TriRpcStatus.INTERNAL.withDescription("Deserialize response failed")
- .withCause(e).asException());
+ .withCause(t).asException());
+ LOGGER.error(String.format("Failed to deserialize triple response, service=%s, method=%s,connection=%s",
+ connection ,requestMetadata.service, requestMetadata.method.getMethodName()),t);
}
}
diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java
index 7024d61531..a3d19abb56 100644
--- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java
+++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java
@@ -330,7 +330,6 @@ public class TripleClientStream extends AbstractStream implements ClientStream {
ReferenceCountUtil.release(data);
if (transportError.description.length() > 512 || endStream) {
handleH2TransportError(transportError);
-
}
return;
}