aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/ruby/ext/grpc/rb_completion_queue.c9
-rw-r--r--src/ruby/ext/grpc/rb_server.c1
2 files changed, 2 insertions, 8 deletions
diff --git a/src/ruby/ext/grpc/rb_completion_queue.c b/src/ruby/ext/grpc/rb_completion_queue.c
index cef8cd75d2..33338d68e9 100644
--- a/src/ruby/ext/grpc/rb_completion_queue.c
+++ b/src/ruby/ext/grpc/rb_completion_queue.c
@@ -80,7 +80,7 @@ static void grpc_rb_completion_queue_shutdown_drain(grpc_completion_queue *cq) {
grpc_completion_queue_shutdown(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
* to gpr_inf_future.
*
@@ -95,16 +95,11 @@ static void grpc_rb_completion_queue_shutdown_drain(grpc_completion_queue *cq) {
do {
rb_thread_call_without_gvl(grpc_rb_completion_queue_next_no_gil,
(void *)&next_call, NULL, NULL);
- if (next_call.event == NULL) {
- break;
- }
- type = next_call.event->type;
+ type = next_call.event.type;
if (type != GRPC_QUEUE_SHUTDOWN) {
++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);
}
diff --git a/src/ruby/ext/grpc/rb_server.c b/src/ruby/ext/grpc/rb_server.c
index a013dbcfc9..7db9e989de 100644
--- a/src/ruby/ext/grpc/rb_server.c
+++ b/src/ruby/ext/grpc/rb_server.c
@@ -233,7 +233,6 @@ static VALUE grpc_rb_server_request_call(VALUE self, VALUE cqueue,
}
if (!ev.success) {
grpc_request_call_stack_cleanup(&st);
- grpc_event_finish(ev);
rb_raise(grpc_rb_eCallError, "request_call completion failed");
return Qnil;
}