diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/surface/call.c | 4 | ||||
-rw-r--r-- | src/core/surface/server.c | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 7c91ca917c..7a9fe30732 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -411,7 +411,9 @@ static int need_more_data(grpc_call *call) { is_op_live(call, GRPC_IOREQ_RECV_TRAILING_METADATA) || is_op_live(call, GRPC_IOREQ_RECV_STATUS) || is_op_live(call, GRPC_IOREQ_RECV_STATUS_DETAILS) || - is_op_live(call, GRPC_IOREQ_RECV_CLOSE); + is_op_live(call, GRPC_IOREQ_RECV_CLOSE) || + (call->write_state == WRITE_STATE_INITIAL && !call->is_client && + call->read_state != READ_STATE_STREAM_CLOSED); } static void unlock(grpc_call *call) { diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 28f42f0fc3..2f00ad0bc6 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -925,6 +925,8 @@ void grpc_server_destroy(grpc_server *server) { channel_data *c; listener *l; size_t i; + call_data *calld; + gpr_mu_lock(&server->mu); if (!server->shutdown) { gpr_mu_unlock(&server->mu); @@ -949,6 +951,15 @@ void grpc_server_destroy(grpc_server *server) { gpr_free(l); } + while ((calld = call_list_remove_head(&server->lists[PENDING_START], + PENDING_START)) != NULL) { + gpr_log(GPR_DEBUG, "server destroys call %p", calld->call); + calld->state = ZOMBIED; + grpc_iomgr_add_callback( + kill_zombie, + grpc_call_stack_element(grpc_call_get_call_stack(calld->call), 0)); + } + for (c = server->root_channel_data.next; c != &server->root_channel_data; c = c->next) { shutdown_channel(c); |