Skip to content
Snippets Groups Projects
Commit a61ca70e authored by Vijay Pai's avatar Vijay Pai
Browse files

Merge pull request #2623 from ctiller/tightly-they-took-the-token-to-the-tent

Handle a race where a new call comes in post-shutdown a little better
parents 3a442d9b 9835a136
No related branches found
No related tags found
No related merge requests found
...@@ -400,6 +400,15 @@ static void finish_start_new_rpc(grpc_server *server, grpc_call_element *elem, ...@@ -400,6 +400,15 @@ static void finish_start_new_rpc(grpc_server *server, grpc_call_element *elem,
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
int request_id; int request_id;
if (gpr_atm_acq_load(&server->shutdown_flag)) {
gpr_mu_lock(&calld->mu_state);
calld->state = ZOMBIED;
gpr_mu_unlock(&calld->mu_state);
grpc_iomgr_closure_init(&calld->kill_zombie_closure, kill_zombie, elem);
grpc_iomgr_add_callback(&calld->kill_zombie_closure);
return;
}
request_id = gpr_stack_lockfree_pop(request_matcher->requests); request_id = gpr_stack_lockfree_pop(request_matcher->requests);
if (request_id == -1) { if (request_id == -1) {
gpr_mu_lock(&server->mu_call); gpr_mu_lock(&server->mu_call);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment