Skip to content

Conversation

Jozott00
Copy link
Collaborator

@Jozott00 Jozott00 commented Aug 8, 2025

Subsystem
gRPC/Protobuf

Solution
This PR adds the GrpcException as well its sealed sub types ProtobufEncodingException and ProtobufDecodingException.

Additionally, unknown fields are now skipped without an error.

There was also a bug in the native WireEncoder that caused the string length to include the null termination character, resulting in an invalid protobuf wire encoding of the message.

@Jozott00 Jozott00 requested a review from Mr3zee August 8, 2025 10:12
@Jozott00 Jozott00 added the feature New feature or request label Aug 8, 2025
@Jozott00 Jozott00 self-assigned this Aug 8, 2025
Copy link
Member

@Mr3zee Mr3zee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@Jozott00 Jozott00 force-pushed the grpc/pb-error branch 2 times, most recently from 111f0f8 to d604bd2 Compare August 8, 2025 10:45
Copy link
Member

@Mr3zee Mr3zee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for addressing the comments!
Let's merge after the last minor fix below

@Jozott00 Jozott00 merged commit a404252 into grpc-common Aug 11, 2025
2 of 3 checks passed
@Jozott00 Jozott00 deleted the grpc/pb-error branch August 18, 2025 16:17
Mr3zee pushed a commit that referenced this pull request Aug 21, 2025
* grpc-pb: Skip unknown fields

Signed-off-by: Johannes Zottele <[email protected]>

* grpc-pb: Add InvalidProtobufError class

Signed-off-by: Johannes Zottele <[email protected]>

* grpc-pb: Throw error in decoder instead of hadError() check

Signed-off-by: Johannes Zottele <[email protected]>

* grpc-pb: Fix string encoding bug

Signed-off-by: Johannes Zottele <[email protected]>

* grpc-pb: Remove hadError() method

Signed-off-by: Johannes Zottele <[email protected]>

* grpc-pb: Throw exception instead of Boolean when encoding value

Signed-off-by: Johannes Zottele <[email protected]>

* grpc-pb: Move JVM exception check to CODEC to avoid performance overhead

Signed-off-by: Johannes Zottele <[email protected]>

* grpc-pb: Address PR comments

Signed-off-by: Johannes Zottele <[email protected]>

* grpc-pb: Address PR Comments

Signed-off-by: Johannes Zottele <[email protected]>

---------

Signed-off-by: Johannes Zottele <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants