-
Notifications
You must be signed in to change notification settings - Fork 279
Description
After receiving a timeout (GRPC code 4, codeName DEADLINE_EXCEEDED)
The next request almost always errors with
- code 2
- codeName UNKNOWN
- message: HTTP/2 error: Connection error: Connection is being forcefully terminated. (errorCode: 1)
HTTP/2 errorCode 1 is PROTOCOL_ERROR according to https://www.iana.org/assignments/http2-parameters/http2-parameters.xhtml#error-code
<version of the grpc-dart packages used; see your pubspec.lock
file>
grpc version: both "3.2.3" and "3.2.4" tested, both present the issue.
Tested with two Android phones connected to the same wifi.
Repro steps
Create a server, run it and run this code in the client:
Request request = Request();
for (int i = 0; i< size; i++) {
try {
CallOptions callOptions=CallOptions(timeout: Duration (milliseconds: 50));
MyResponse response = await myGRPC!.getResponse(request, options: callOptions);
// log response
} on GrpcError catch (e) {
// log e
}
}
Expected result: Some good responses, some timeouts, but no consistent HTTP/2 protocol errors after a timeout
Actual result: Every timeout
GRPC code 4, codeName DEADLINE_EXCEEDED
is followed by an HTTP/2 error
HTTP/2 error: Connection error: Connection is being forcefully terminated. (errorCode: 1)
Details
I suspect the dart GRPC libraries need to verify that on the event of a timeout, the HTTP/2 protocol is still being followed so no PROTOCOL_ERROR is produced on subsequent calls.
Otherwise, if this is desired behaviour, it should be documented at CallOptions class in package:grpc/src/client/call.dart
Any input is appreciated regarding this.