-
Notifications
You must be signed in to change notification settings - Fork 272
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
KeepAlive Ping Error Handling #738
Comments
Thanks for reporting! I will take a look. Do you have any more information on the environment where this occurs? I haven't seen this happening on my machine. |
I was using the following
When we had users using the app in this situation, errors were reported to Firebase Crashlytics and Bugsnag.
This is what was flowing to PlatformDispatcher.onError in the Flutter application. This means that an uncaught error is occurring somewhere. The place where the request is sent is enclosed in try/catch as described above. This is why I thought the KeepAlive ping was suspicious. Then we looked at where this error originated in the first place. https://github.com/dart-lang/http2/blob/master/lib/src/connection.dart There are several places in this code where the following calls are made _terminate(ErrorCode.CONNECT_ERROR, causedByTransportError: true); The following is implemented in the var exception = TransportConnectionException(
errorCode, 'Connection is being forcefully terminated.');
// Close all streams & stream queues
_streams.terminate(exception);
// Close the connection queues
_incomingQueue.terminate(exception);
_outgoingQueue.terminate(exception);
_pingHandler.terminate(exception);
_settingsHandler.terminate(exception); From the error message, we could see that it was this very exception that occurred this time. We found that this exception was being passed to streams, incomingQueue, outgoingQueue, pingHandler, and settingsHandler. Since we thought ping was suspicious, we checked the code of this _pingHandler and tracked how it was being used from the grpc-dart side. As a result, we found that no catchError was made at the point of the first patch. After applying the patch, I have had users use the app, and the error is no longer being sent to PlatformDispatcher.onError. We do not know how to reproduce this reliably. We are using grpc via an AWS load balancer. |
Thanks for the write-up, this is helpful. |
The following is an excerpt of the code that sets up KeepAlive written in
lib/src/client/http2_connection.dart
We found that the above code occasionally threw an exception when calling the
transport.ping()
.Sometimes an HTTP/2 Connection error occurred, starting from the
http2
library side.Therefore, we have applied the following patch to prevent the exception from flying.
I am not sure if this is the appropriate way to fix the problem, but I will report it to you.
The text was updated successfully, but these errors were encountered: