Skip to content

Any type throwing NPE within HttpJson server streaming calls. #3652

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

Open
baeminbo opened this issue Feb 22, 2025 · 1 comment
Open

Any type throwing NPE within HttpJson server streaming calls. #3652

baeminbo opened this issue Feb 22, 2025 · 1 comment

Comments

@baeminbo
Copy link

The HttpJson server streaming callable causes a NullPointerException (NPE) when processing responses containing Any type values. This is because the TypeRegistry in CallOptions is typically null, which is passed to ProtoMessageResponseParser.parse() within HttpJsonClientCallImpl, resulting in NPE.

For example, Spanner's BatchWriteResponse includes a Status field with an Any type details value. Consequently, when the server returns an error, the response parsing results in NPE.

Please take a look at a concrete example in googleapis/java-spanner#3640 for detailed reproduction steps.

@baeminbo
Copy link
Author

FYI. I created a fix for: #3640.

This issue was discussed with @blakeli0 in googleapis/java-spanner#3640 regarding:

  1. this issue not present in other streaming types
  2. even with the fix, InvalidProtocolBufferException still thrown because the default TypeRegistry doesn't include the types for Status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant