Merge pull request #16764 from yashykt/keepaliv_status

Keepalive watchdog firing should return status UNAVAILABLE
pull/16712/merge
Yash Tibrewal 6 years ago committed by GitHub
commit 3b26fe7262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      doc/statuscodes.md
  2. 8
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  3. 2
      src/objective-c/tests/InteropTests.m
  4. 2
      test/core/end2end/tests/keepalive_timeout.cc

@ -38,7 +38,7 @@ situations in which they are generated.
| Error parsing response proto | INTERNAL | Client|
| Error parsing request proto | INTERNAL | Server|
| Sent or received message was larger than configured limit | RESOURCE_EXHAUSTED | Both |
| Keepalive watchdog times out | INTERNAL | Both |
| Keepalive watchdog times out | UNAVAILABLE | Both |
The following status codes are never generated by the library:
- INVALID_ARGUMENT

@ -2762,10 +2762,10 @@ static void keepalive_watchdog_fired_locked(void* arg, grpc_error* error) {
if (error == GRPC_ERROR_NONE) {
t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_DYING;
close_transport_locked(
t,
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"keepalive watchdog timeout"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL));
t, grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"keepalive watchdog timeout"),
GRPC_ERROR_INT_GRPC_STATUS,
GRPC_STATUS_UNAVAILABLE));
}
} else {
/* The watchdog timer should have been cancelled by

@ -545,7 +545,7 @@ BOOL isRemoteInteropTest(NSString *host) {
} else {
// Keepalive should kick after 1s elapsed and fails the call.
XCTAssertNotNil(error);
XCTAssertEqual(error.code, GRPC_STATUS_INTERNAL);
XCTAssertEqual(error.code, GRPC_STATUS_UNAVAILABLE);
XCTAssertEqualObjects(
error.localizedDescription, @"keepalive watchdog timeout",
@"Unexpected failure that is not keepalive watchdog timeout.");

@ -195,7 +195,7 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) {
char* details_str = grpc_slice_to_c_string(details);
char* method_str = grpc_slice_to_c_string(call_details.method);
GPR_ASSERT(status == GRPC_STATUS_INTERNAL);
GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
GPR_ASSERT(0 == grpc_slice_str_cmp(details, "keepalive watchdog timeout"));
GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo"));

Loading…
Cancel
Save