Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helidon exceptions are not propagated up through PbjProtocolHandler to the application via onError #304

Open
Tracked by #306
mattp-swirldslabs opened this issue Oct 15, 2024 · 0 comments
Assignees
Labels
Bug An error that causes the feature to behave differently than what was expected based on design.

Comments

@mattp-swirldslabs
Copy link
Contributor

mattp-swirldslabs commented Oct 15, 2024

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

  1. 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();
    }
  2. Force an exception and note that it's caught in the PbjProtocolHandler.onError() method.
  3. 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:
image

Hedera network

No response

Version

v0.9.9

Operating system

macOS

@mattp-swirldslabs mattp-swirldslabs added the Bug An error that causes the feature to behave differently than what was expected based on design. label Oct 15, 2024
@litt3 litt3 self-assigned this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error that causes the feature to behave differently than what was expected based on design.
Projects
None yet
Development

No branches or pull requests

2 participants