File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
core/src/main/java/io/grpc/internal Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -521,7 +521,6 @@ private void verifySize() {
521521 if (count > maxMessageSize ) {
522522 throw Status .RESOURCE_EXHAUSTED
523523 .withDescription ("Decompressed gRPC message exceeds maximum size " + maxMessageSize )
524- .withCause (new CloseWithHeadersMarker ())
525524 .asRuntimeException ();
526525 }
527526 }
Original file line number Diff line number Diff line change @@ -279,6 +279,12 @@ private void handleInternalError(Throwable internalError) {
279279 serverCallTracer .reportCallEnded (false ); // error so always false
280280 }
281281
282+ private void handleParseError (StatusRuntimeException parseError ) {
283+ log .log (Level .WARNING , "Cancelling the stream because of parse error" , parseError );
284+ stream .cancel (parseError .getStatus ().withCause (new CloseWithHeadersMarker ()));
285+ serverCallTracer .reportCallEnded (false ); // error so always false
286+ }
287+
282288 /**
283289 * All of these callbacks are assumed to called on an application thread, and the caller is
284290 * responsible for handling thrown exceptions.
@@ -337,7 +343,7 @@ private void messagesAvailableInternal(final MessageProducer producer) {
337343 GrpcUtil .closeQuietly (message );
338344 GrpcUtil .closeQuietly (producer );
339345 call .cancelled = true ;
340- call .handleInternalError (e );
346+ call .handleParseError (e );
341347 return ;
342348 }
343349 message .close ();
You can’t perform that action at this time.
0 commit comments