Description
An exception thrown in io.helidon.common.buffers.ReadOnlyArrayData invokes the onError() method in PbjProtocolHandler but that method does not signal an error to the application layer via Flow.Subscriber<? super Bytes> incoming. This prevents the application layer from taking action and cleaning up, etc.
Steps to reproduce
- Put a breakpoint in the
PbjProtocolHandler.onError() method on the running server:
|
public void onError(@NonNull final Throwable throwable) { |
|
if (throwable instanceof final GrpcException grpcException) { |
|
new TrailerBuilder() |
|
.grpcStatus(grpcException.status()) |
|
.statusMessage(grpcException.getMessage()) |
|
.send(); |
|
} else { |
|
LOGGER.log(ERROR, "Failed to send response", throwable); |
|
new TrailerBuilder().grpcStatus(GrpcStatus.INTERNAL).send(); |
|
} |
|
close(); |
|
} |
- Force an exception and note that it's caught in the
PbjProtocolHandler.onError() method.
- Observe that this method never calls
incoming.onError() or an equivalent to notify the application layer there was a problem.
Additional context
This is an example of how grpc.io handles the same exception:

Hedera network
No response
Version
v0.9.9
Operating system
macOS
Description
An exception thrown in
io.helidon.common.buffers.ReadOnlyArrayDatainvokes theonError()method in PbjProtocolHandler but that method does not signal an error to the application layer viaFlow.Subscriber<? super Bytes> incoming. This prevents the application layer from taking action and cleaning up, etc.Steps to reproduce
PbjProtocolHandler.onError()method on the running server:pbj/pbj-core/pbj-grpc-helidon/src/main/java/com/hedera/pbj/grpc/helidon/PbjProtocolHandler.java
Lines 643 to 654 in a2e54fa
PbjProtocolHandler.onError()method.incoming.onError()or an equivalent to notify the application layer there was a problem.Additional context
This is an example of how

grpc.iohandles the same exception:Hedera network
No response
Version
v0.9.9
Operating system
macOS