From 44bb7343da9c0c6141124a420a48048ea0223ecb Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 9 Sep 2016 08:44:05 -0700 Subject: Add documentation for GRPC_ environment variables --- doc/environment_variables.md | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 doc/environment_variables.md (limited to 'doc/environment_variables.md') diff --git a/doc/environment_variables.md b/doc/environment_variables.md new file mode 100644 index 0000000000..18269ef041 --- /dev/null +++ b/doc/environment_variables.md @@ -0,0 +1,61 @@ +gRPC environment variables +-------------------------- + +gRPC C core based implementations (those contained in this repository) expose +some configuration as environment variables that can be set. + +* GRPC_ABORT_ON_LEAKS + A debugging aid to cause a call to abort() when gRPC objects are leaked past + grpc_shutdown() + +* GRPC_GOOGLE_CREDENTIALS_ENV_VAR + The path to find the credentials to use when Google credentials are created + +* GRPC_SSL_CIPHER_SUITES + A colon separated list of cipher suites to use with OpenSSL + +* GRPC_POLL_STRATEGY [posix-style environments only] + Declares which polling engines to try when starting gRPC. + This is a comma-separated list of engines, which are tried in priority order + first -> last. + Available polling engines include: + - epoll (linux-only) - a polling engine based around the epoll family of + system calls + - poll - a portable polling engine based around poll(), intended to be a + fallback engine when nothing better exists + - legacy - the (deprecated) original polling engine for gRPC + +* GRPC_TRACE + A comma separated list of tracers that provide additional insight into how + gRPC C core is processing requests via debug logs. Available tracers include: + - api - traces api calls to the C core + - channel - traces operations on the C core channel stack + - combiner - traces combiner lock state + - compression - traces compression operations + - connectivity_state - traces connectivity state changes to channels + - channel_stack_builder - traces information about channel stacks being built + - http - traces state in the http2 transport engine + - http1 - traces HTTP/1.x operations performed by gRPC + - flowctl - traces http2 flow control + - op_failure - traces error information when failure is pushed onto a + completion queue + - pending_tags - [debug builds only] traces still-in-progress tags on + completion queues + - round_robin - traces the round_robin load balancing policy + - glb - traces the grpclb load balancer + - queue_pluck + - queue_timeout + - secure_endpoint - traces bytes flowing through encrypted channels + - transport_security - traces metadata about secure channel establishment + - tcp - traces bytes in and out of a channel + 'all' can additionally be used to turn all traces on. + Individual traces can be disabled by prefixing them with '-'. + Example: + export GRPC_TRACE=all,-pending_tags + +* GRPC_VERBOSITY + Default gRPC logging verbosity - one of: + - DEBUG - log all gRPC messages + - INFO - log INFO and ERROR message + - ERROR - log only errors + -- cgit v1.2.3 From 18c09bf2916c631cdd38cfe6980151653eec38bd Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 9 Sep 2016 13:07:17 -0700 Subject: Review feedback --- doc/environment_variables.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/environment_variables.md') diff --git a/doc/environment_variables.md b/doc/environment_variables.md index 18269ef041..578bfe7eb7 100644 --- a/doc/environment_variables.md +++ b/doc/environment_variables.md @@ -6,13 +6,16 @@ some configuration as environment variables that can be set. * GRPC_ABORT_ON_LEAKS A debugging aid to cause a call to abort() when gRPC objects are leaked past - grpc_shutdown() + grpc_shutdown(). Set to 1 to cause the abort, if unset or 0 it does not + abort the process. * GRPC_GOOGLE_CREDENTIALS_ENV_VAR The path to find the credentials to use when Google credentials are created * GRPC_SSL_CIPHER_SUITES A colon separated list of cipher suites to use with OpenSSL + Defaults to: + ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384 * GRPC_POLL_STRATEGY [posix-style environments only] Declares which polling engines to try when starting gRPC. -- cgit v1.2.3 From 687a0e641057d42394e1574629df6368cc6e5322 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 21 Sep 2016 10:48:59 -0700 Subject: Add trace for server channel events --- doc/environment_variables.md | 2 +- src/core/lib/surface/init.c | 1 + src/core/lib/surface/server.c | 4 +++- src/core/lib/surface/server.h | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) (limited to 'doc/environment_variables.md') diff --git a/doc/environment_variables.md b/doc/environment_variables.md index 578bfe7eb7..b790f627ea 100644 --- a/doc/environment_variables.md +++ b/doc/environment_variables.md @@ -48,6 +48,7 @@ some configuration as environment variables that can be set. - glb - traces the grpclb load balancer - queue_pluck - queue_timeout + - server_channel - lightweight trace of significant server channel events - secure_endpoint - traces bytes flowing through encrypted channels - transport_security - traces metadata about secure channel establishment - tcp - traces bytes in and out of a channel @@ -61,4 +62,3 @@ some configuration as environment variables that can be set. - DEBUG - log all gRPC messages - INFO - log INFO and ERROR message - ERROR - log only errors - diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index 2135507b7a..3cbbaa7b0c 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -177,6 +177,7 @@ void grpc_init(void) { grpc_register_tracer("compression", &grpc_compression_trace); grpc_register_tracer("queue_pluck", &grpc_cq_pluck_trace); grpc_register_tracer("combiner", &grpc_combiner_trace); + grpc_register_tracer("server_channel", &grpc_server_channel_trace); // Default pluck trace to 1 grpc_cq_pluck_trace = 1; grpc_register_tracer("queue_timeout", &grpc_cq_event_timeout_trace); diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index 9a9fcddb6e..cec3e3ce97 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -71,6 +71,8 @@ typedef struct registered_method registered_method; typedef enum { BATCH_CALL, REGISTERED_CALL } requested_call_type; +int grpc_server_channel_trace = 0; + typedef struct requested_call { requested_call_type type; size_t cq_idx; @@ -440,7 +442,7 @@ static void destroy_channel(grpc_exec_ctx *exec_ctx, channel_data *chand, chand->finish_destroy_channel_closure.cb = finish_destroy_channel; chand->finish_destroy_channel_closure.cb_arg = chand; - if (error != GRPC_ERROR_NONE) { + if (grpc_server_channel_trace && error != GRPC_ERROR_NONE) { const char *msg = grpc_error_string(error); gpr_log(GPR_INFO, "Disconnected client: %s", msg); grpc_error_free_string(msg); diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h index fb6e4d60c5..2a4e65c7ce 100644 --- a/src/core/lib/surface/server.h +++ b/src/core/lib/surface/server.h @@ -40,6 +40,9 @@ extern const grpc_channel_filter grpc_server_top_filter; +/** Lightweight tracing of server channel state */ +extern int grpc_server_channel_trace; + /* Add a listener to the server: when the server starts, it will call start, and when it shuts down, it will call destroy */ void grpc_server_add_listener( -- cgit v1.2.3 From 694cc814bd36d1779c08ee08825a723a5b6e9a02 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 21 Sep 2016 10:52:56 -0700 Subject: Fix docs --- doc/environment_variables.md | 5 ++++- third_party/nanopb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'doc/environment_variables.md') diff --git a/doc/environment_variables.md b/doc/environment_variables.md index 578bfe7eb7..74b7862c7d 100644 --- a/doc/environment_variables.md +++ b/doc/environment_variables.md @@ -9,7 +9,7 @@ some configuration as environment variables that can be set. grpc_shutdown(). Set to 1 to cause the abort, if unset or 0 it does not abort the process. -* GRPC_GOOGLE_CREDENTIALS_ENV_VAR +* GOOGLE_APPLICATION_CREDENTIALS The path to find the credentials to use when Google credentials are created * GRPC_SSL_CIPHER_SUITES @@ -17,6 +17,9 @@ some configuration as environment variables that can be set. Defaults to: ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-GCM-SHA384 +* GRPC_DEFAULT_SSL_ROOTS_FILE_PATH + PEM file to load SSL roots from + * GRPC_POLL_STRATEGY [posix-style environments only] Declares which polling engines to try when starting gRPC. This is a comma-separated list of engines, which are tried in priority order diff --git a/third_party/nanopb b/third_party/nanopb index f8ac463766..68a86e9648 160000 --- a/third_party/nanopb +++ b/third_party/nanopb @@ -1 +1 @@ -Subproject commit f8ac463766281625ad710900479130c7fcb4d63b +Subproject commit 68a86e96481e6bea987df8de47027847b30c325b -- cgit v1.2.3