diff options
author | Mark D. Roth <roth@google.com> | 2017-11-27 10:16:55 -0800 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2017-11-27 10:16:55 -0800 |
commit | dc8be882f7489d38c9fe1ea61cf70a349b4a9357 (patch) | |
tree | 76f1f59f06862e22db2c4c3310a9d4ca2ea08c69 /src/core/ext/transport/chttp2/server | |
parent | d0f56a9997776d837097ee9709c64802c52dd120 (diff) |
Fix handling of grpc shutdown in timer callback.
Diffstat (limited to 'src/core/ext/transport/chttp2/server')
-rw-r--r-- | src/core/ext/transport/chttp2/server/chttp2_server.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 88d848095b..1f4517ac28 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -81,7 +81,9 @@ static void server_connection_state_unref( static void on_timeout(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { server_connection_state* connection_state = (server_connection_state*)arg; - if (error == GRPC_ERROR_NONE) { + // Note that we may be called with GRPC_ERROR_NONE when the timer fires + // or with an error indicating that the timer system is being shut down. + if (error != GRPC_ERROR_CANCELLED) { grpc_transport_op* op = grpc_make_transport_op(nullptr); op->disconnect_with_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING( "Did not receive HTTP/2 settings before handshake timeout"); |