grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

AssertionError when sending gRPC call with HTTP/2 and QUIC enabled using Cronet

Open cshai opened this issue 11 months ago • 1 comments

In my android application, I am using the ExperimentalCronetEngine to enable HTTP/2 and QUIC support, but I encountered an issue during the execution. When initializing the Cronet engine with the following code:

engine = ExperimentalCronetEngine.Builder(applicationContext /* Android Context */) .enableHttp2(true) .enableQuic(true) .build();

Dependencies: • io.grpc:grpc-okhttp:1.71.0 • io.grpc:grpc-stub:1.71.0 • io.grpc:grpc-cronet:1.71.0@aar • org.chromium.net:cronet-api:119.6045.31 • org.chromium.net:cronet-embedded:119.6045.31

send call after:

I received the following error message: W java.lang.AssertionError 2025-03-14 13:03:47.217 22196-22495 System.err xxxxx W at org.chromium.net.impl.CronetMetrics.(CronetMetrics.java:104) 2025-03-14 13:03:47.217 22196-22495 System.err xxxxxx W at org.chromium.net.impl.CronetBidirectionalStream.onMetricsCollected(CronetBidirectionalStream.java:682)

The error seems related to the CronetMetrics initialization and the collection of metrics for the bidirectional stream. It is triggered after sending the gRPC call, when Cronet tries to collect metrics for the stream.

cshai avatar Mar 14 '25 05:03 cshai

The CronetMetrics handling all happens in the Cronet code itself, not in the grpc-cronet code. Can you check with gRPC Java 1.63.2 that used an earlier version of cronet API org.chromium.net:cronet-api:108.5359.79?

kannanjgithub avatar Mar 20 '25 11:03 kannanjgithub

This doesn't seem like a gRPC issue, so closing. If more stacktrace shows this is gRPC, post it and we can reopen. If this is fixed with a newer version of cronet, that'd be interesting to know.

ejona86 avatar Sep 04 '25 04:09 ejona86