Skip to content

Conversation

vimanikag
Copy link
Contributor

@vimanikag vimanikag commented Sep 15, 2025

Fixes : #11246

@vimanikag vimanikag changed the title 11246 :: Unexpected error when server expands a compressed message to learn it is too large 11246 :: Unexpected error when server expands a compressed message to learn it is too large Sep 15, 2025
Comment on lines +816 to +820
if (t instanceof StatusRuntimeException) {
if (((StatusRuntimeException) t).getStatus().getCode() == Status.Code.RESOURCE_EXHAUSTED) {
statusToPropagate = ((StatusRuntimeException) t).getStatus().withCause(t);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be refactored to use a single if. But, personally I would extract out the explicit conversion of t into a variable.

ServerStreamListener mockListener = mock(ServerStreamListener.class);
listener.setListener(mockListener);

RuntimeException expectedT = new RuntimeException();
Copy link
Contributor

Choose a reason for hiding this comment

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

expectedT ?

Comment on lines +817 to +818
if (((StatusRuntimeException) t).getStatus().getCode() == Status.Code.RESOURCE_EXHAUSTED) {
statusToPropagate = ((StatusRuntimeException) t).getStatus().withCause(t);
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there no other cases where we can get "RESOURCE_EXHAUSTED" ? As, this is not tied specifically to marshaling the intended behavior can change if and when new "RESOURCE_EXHAUSTED" are added.

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

Successfully merging this pull request may close these issues.

Unexpected error when server expands a compressed message to learn it is too large
2 participants