aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/surface/server.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-21 16:52:06 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-21 16:52:06 -0800
commit7486144de0577e3e9453feec328741180d1f1bfa (patch)
tree23eb0c5490c5a0a6057407a05f62efac1181389b /src/core/lib/surface/server.cc
parentd48981221542a5bd760b64e5af379adb0e846bba (diff)
parentd88421a995bf473202ecf0650eb8339a3cea3e93 (diff)
Merge master
Diffstat (limited to 'src/core/lib/surface/server.cc')
-rw-r--r--src/core/lib/surface/server.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc
index 49f453569c..e003b5410b 100644
--- a/src/core/lib/surface/server.cc
+++ b/src/core/lib/surface/server.cc
@@ -59,8 +59,7 @@ typedef struct registered_method registered_method;
typedef enum { BATCH_CALL, REGISTERED_CALL } requested_call_type;
-grpc_tracer_flag grpc_server_channel_trace =
- GRPC_TRACER_INITIALIZER(false, "server_channel");
+grpc_core::TraceFlag grpc_server_channel_trace(false, "server_channel");
typedef struct requested_call {
gpr_mpscq_node request_link; /* must be first */
@@ -343,14 +342,8 @@ static void request_matcher_kill_requests(grpc_server* server,
grpc_error* error) {
requested_call* rc;
for (size_t i = 0; i < server->cq_count; i++) {
- /* Here we know:
- 1. no requests are being added (since the server is shut down)
- 2. no other threads are pulling (since the shut down process is single
- threaded)
- So, we can ignore the queue lock and just pop, with the guarantee that a
- NULL returned here truly means that the queue is empty */
- while ((rc = (requested_call*)gpr_mpscq_pop(
- &rm->requests_per_cq[i].queue)) != nullptr) {
+ while ((rc = (requested_call*)gpr_locked_mpscq_pop(
+ &rm->requests_per_cq[i])) != nullptr) {
fail_call(server, i, rc, GRPC_ERROR_REF(error));
}
}
@@ -425,7 +418,7 @@ static void destroy_channel(channel_data* chand, grpc_error* error) {
GRPC_CLOSURE_INIT(&chand->finish_destroy_channel_closure,
finish_destroy_channel, chand, grpc_schedule_on_exec_ctx);
- if (GRPC_TRACER_ON(grpc_server_channel_trace) && error != GRPC_ERROR_NONE) {
+ if (grpc_server_channel_trace.enabled() && error != GRPC_ERROR_NONE) {
const char* msg = grpc_error_string(error);
gpr_log(GPR_INFO, "Disconnected client: %s", msg);
}