okhttp: error in frame handler closes with INTERNAL (#5049)

This commit is contained in:
Eric Gribkoff 2018-11-09 08:48:13 -08:00 committed by GitHub
parent 11154074bd
commit cab5966415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -1011,9 +1011,9 @@ class OkHttpClientTransport implements ConnectionClientTransport, TransportExcep
} catch (Throwable t) {
// TODO(madongfly): Send the exception message to the server.
startGoAway(
0,
ErrorCode.PROTOCOL_ERROR,
Status.UNAVAILABLE.withDescription("error in frame handler").withCause(t));
0,
ErrorCode.PROTOCOL_ERROR,
Status.INTERNAL.withDescription("error in frame handler").withCause(t));
} finally {
try {
frameReader.close();

View File

@ -301,9 +301,9 @@ public class OkHttpClientTransportTest {
listener2.waitUntilStreamClosed();
assertEquals(0, activeStreamCount());
assertEquals(Status.UNAVAILABLE.getCode(), listener1.status.getCode());
assertEquals(Status.INTERNAL.getCode(), listener1.status.getCode());
assertEquals(NETWORK_ISSUE_MESSAGE, listener1.status.getCause().getMessage());
assertEquals(Status.UNAVAILABLE.getCode(), listener2.status.getCode());
assertEquals(Status.INTERNAL.getCode(), listener2.status.getCode());
assertEquals(NETWORK_ISSUE_MESSAGE, listener2.status.getCause().getMessage());
verify(transportListener, timeout(TIME_OUT_MS)).transportShutdown(isA(Status.class));
verify(transportListener, timeout(TIME_OUT_MS)).transportTerminated();
@ -329,7 +329,7 @@ public class OkHttpClientTransportTest {
listener.waitUntilStreamClosed();
assertEquals(0, activeStreamCount());
assertEquals(Status.UNAVAILABLE.getCode(), listener.status.getCode());
assertEquals(Status.INTERNAL.getCode(), listener.status.getCode());
assertEquals(ERROR_MESSAGE, listener.status.getCause().getMessage());
verify(transportListener, timeout(TIME_OUT_MS)).transportShutdown(isA(Status.class));
verify(transportListener, timeout(TIME_OUT_MS)).transportTerminated();