Skip to content
Snippets Groups Projects
Commit 3c78b4e0 authored by Craig Tiller's avatar Craig Tiller
Browse files

Ruby progress

parent 3a488085
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,7 @@ static void grpc_rb_completion_queue_shutdown_drain(grpc_completion_queue *cq) { ...@@ -80,7 +80,7 @@ static void grpc_rb_completion_queue_shutdown_drain(grpc_completion_queue *cq) {
grpc_completion_queue_shutdown(cq); grpc_completion_queue_shutdown(cq);
next_call.cq = cq; next_call.cq = cq;
next_call.event = NULL; next_call.event.type = GRPC_QUEUE_TIMEOUT;
/* TODO: the timeout should be a module level constant that defaults /* TODO: the timeout should be a module level constant that defaults
* to gpr_inf_future. * to gpr_inf_future.
* *
...@@ -95,16 +95,11 @@ static void grpc_rb_completion_queue_shutdown_drain(grpc_completion_queue *cq) { ...@@ -95,16 +95,11 @@ static void grpc_rb_completion_queue_shutdown_drain(grpc_completion_queue *cq) {
do { do {
rb_thread_call_without_gvl(grpc_rb_completion_queue_next_no_gil, rb_thread_call_without_gvl(grpc_rb_completion_queue_next_no_gil,
(void *)&next_call, NULL, NULL); (void *)&next_call, NULL, NULL);
if (next_call.event == NULL) { type = next_call.event.type;
break;
}
type = next_call.event->type;
if (type != GRPC_QUEUE_SHUTDOWN) { if (type != GRPC_QUEUE_SHUTDOWN) {
++drained; ++drained;
rb_warning("completion queue shutdown: %d undrained events", drained); rb_warning("completion queue shutdown: %d undrained events", drained);
} }
grpc_event_finish(next_call.event);
next_call.event = NULL;
} while (type != GRPC_QUEUE_SHUTDOWN); } while (type != GRPC_QUEUE_SHUTDOWN);
} }
......
...@@ -233,7 +233,6 @@ static VALUE grpc_rb_server_request_call(VALUE self, VALUE cqueue, ...@@ -233,7 +233,6 @@ static VALUE grpc_rb_server_request_call(VALUE self, VALUE cqueue,
} }
if (!ev.success) { if (!ev.success) {
grpc_request_call_stack_cleanup(&st); grpc_request_call_stack_cleanup(&st);
grpc_event_finish(ev);
rb_raise(grpc_rb_eCallError, "request_call completion failed"); rb_raise(grpc_rb_eCallError, "request_call completion failed");
return Qnil; return Qnil;
} }
......
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