You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "EarthChen (via GitHub)" <gi...@apache.org> on 2023/09/26 07:15:48 UTC
[GitHub] [dubbo] EarthChen commented on a diff in pull request #13102: Release ByteBuf when handle onData failed
EarthChen commented on code in PR #13102:
URL: https://github.com/apache/dubbo/pull/13102#discussion_r1336734422
##########
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/stream/TripleClientStream.java:
##########
@@ -449,23 +449,25 @@ public void onHeader(Http2Headers headers, boolean endStream) {
@Override
public void onData(ByteBuf data, boolean endStream) {
- executor.execute(() -> {
- if (transportError != null) {
- transportError.appendDescription(
- "Data:" + data.toString(StandardCharsets.UTF_8));
- ReferenceCountUtil.release(data);
- if (transportError.description.length() > 512 || endStream) {
- handleH2TransportError(transportError);
- }
- return;
- }
- if (!headerReceived) {
- handleH2TransportError(TriRpcStatus.INTERNAL.withDescription(
- "headers not received before payload"));
- return;
+ executor.execute(() -> doOnData(data, endStream), () -> ReferenceCountUtil.release(data));
Review Comment:
But is there anything better here?
--
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: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org