diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2016-06-03 16:07:41 -0400 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2016-06-03 16:07:41 -0400 |
commit | d38b2c479a53a15ea080a468bc54295baa78b386 (patch) | |
tree | 69794807fc0fda01607060f3fb5814faf9c5381f /src | |
parent | 3dbafd5923f11ffd73d702a7dc4118a8d1f241fc (diff) | |
parent | 48ed92ea38f40d62467eb7955bd4b8bb7cd0ef24 (diff) |
Merge pull request #6761 from ctiller/there-were-no-fatalities
Rename GRPC_CHANNEL_FATAL_FAILURE --> GRPC_CHANNEL_SHUTDOWN
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ext/client_config/channel_connectivity.c | 2 | ||||
-rw-r--r-- | src/core/ext/client_config/client_channel.c | 13 | ||||
-rw-r--r-- | src/core/ext/client_config/subchannel.c | 4 | ||||
-rw-r--r-- | src/core/ext/lb_policy/pick_first/pick_first.c | 10 | ||||
-rw-r--r-- | src/core/ext/lb_policy/round_robin/round_robin.c | 6 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/chttp2_transport.c | 4 | ||||
-rw-r--r-- | src/core/lib/surface/lame_client.c | 4 | ||||
-rw-r--r-- | src/core/lib/surface/server.c | 2 | ||||
-rw-r--r-- | src/core/lib/transport/connectivity_state.c | 8 | ||||
-rw-r--r-- | src/node/ext/node_grpc.cc | 2 | ||||
-rw-r--r-- | src/php/ext/grpc/php_grpc.c | 2 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi | 2 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi | 2 | ||||
-rw-r--r-- | src/ruby/ext/grpc/rb_channel.c | 2 |
14 files changed, 31 insertions, 32 deletions
diff --git a/src/core/ext/client_config/channel_connectivity.c b/src/core/ext/client_config/channel_connectivity.c index 3ebc333608..cc60f2485a 100644 --- a/src/core/ext/client_config/channel_connectivity.c +++ b/src/core/ext/client_config/channel_connectivity.c @@ -62,7 +62,7 @@ grpc_connectivity_state grpc_channel_check_connectivity_state( "not a (u)client channel, but '%s'", client_channel_elem->filter->name); grpc_exec_ctx_finish(&exec_ctx); - return GRPC_CHANNEL_FATAL_FAILURE; + return GRPC_CHANNEL_SHUTDOWN; } typedef enum { diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index 642ae9ce59..713c2c7814 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -119,7 +119,7 @@ static void set_channel_connectivity_state_locked(grpc_exec_ctx *exec_ctx, grpc_connectivity_state state, const char *reason) { if ((state == GRPC_CHANNEL_TRANSIENT_FAILURE || - state == GRPC_CHANNEL_FATAL_FAILURE) && + state == GRPC_CHANNEL_SHUTDOWN) && chand->lb_policy != NULL) { /* cancel fail-fast picks */ grpc_lb_policy_cancel_picks( @@ -136,8 +136,7 @@ static void on_lb_policy_state_changed_locked( /* check if the notification is for a stale policy */ if (w->lb_policy != w->chand->lb_policy) return; - if (publish_state == GRPC_CHANNEL_FATAL_FAILURE && - w->chand->resolver != NULL) { + if (publish_state == GRPC_CHANNEL_SHUTDOWN && w->chand->resolver != NULL) { publish_state = GRPC_CHANNEL_TRANSIENT_FAILURE; grpc_resolver_channel_saw_error(exec_ctx, w->chand->resolver); GRPC_LB_POLICY_UNREF(exec_ctx, w->chand->lb_policy, "channel"); @@ -145,7 +144,7 @@ static void on_lb_policy_state_changed_locked( } set_channel_connectivity_state_locked(exec_ctx, w->chand, publish_state, "lb_changed"); - if (w->state != GRPC_CHANNEL_FATAL_FAILURE) { + if (w->state != GRPC_CHANNEL_SHUTDOWN) { watch_lb_policy(exec_ctx, w->chand, w->lb_policy, w->state); } } @@ -237,7 +236,7 @@ static void cc_on_config_changed(grpc_exec_ctx *exec_ctx, void *arg, chand->resolver = NULL; } set_channel_connectivity_state_locked( - exec_ctx, chand, GRPC_CHANNEL_FATAL_FAILURE, "resolver_gone"); + exec_ctx, chand, GRPC_CHANNEL_SHUTDOWN, "resolver_gone"); gpr_mu_unlock(&chand->mu_config); } @@ -292,8 +291,8 @@ static void cc_start_transport_op(grpc_exec_ctx *exec_ctx, } if (op->disconnect && chand->resolver != NULL) { - set_channel_connectivity_state_locked( - exec_ctx, chand, GRPC_CHANNEL_FATAL_FAILURE, "disconnect"); + set_channel_connectivity_state_locked(exec_ctx, chand, + GRPC_CHANNEL_SHUTDOWN, "disconnect"); grpc_resolver_shutdown(exec_ctx, chand->resolver); GRPC_RESOLVER_UNREF(exec_ctx, chand->resolver, "channel"); chand->resolver = NULL; diff --git a/src/core/ext/client_config/subchannel.c b/src/core/ext/client_config/subchannel.c index f7d98ec4d9..3a635be02f 100644 --- a/src/core/ext/client_config/subchannel.c +++ b/src/core/ext/client_config/subchannel.c @@ -480,11 +480,11 @@ static void subchannel_on_child_state_changed(grpc_exec_ctx *exec_ctx, void *p, if (iomgr_success) { if (sw->connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) { /* any errors on a subchannel ==> we're done, create a new one */ - sw->connectivity_state = GRPC_CHANNEL_FATAL_FAILURE; + sw->connectivity_state = GRPC_CHANNEL_SHUTDOWN; } grpc_connectivity_state_set(exec_ctx, &c->state_tracker, sw->connectivity_state, "reflect_child"); - if (sw->connectivity_state != GRPC_CHANNEL_FATAL_FAILURE) { + if (sw->connectivity_state != GRPC_CHANNEL_SHUTDOWN) { grpc_connected_subchannel_notify_on_state_change( exec_ctx, GET_CONNECTED_SUBCHANNEL(c, no_barrier), NULL, &sw->connectivity_state, &sw->closure); diff --git a/src/core/ext/lb_policy/pick_first/pick_first.c b/src/core/ext/lb_policy/pick_first/pick_first.c index 0d215cd196..b5797da832 100644 --- a/src/core/ext/lb_policy/pick_first/pick_first.c +++ b/src/core/ext/lb_policy/pick_first/pick_first.c @@ -104,7 +104,7 @@ static void pf_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { pp = p->pending_picks; p->pending_picks = NULL; grpc_connectivity_state_set(exec_ctx, &p->state_tracker, - GRPC_CHANNEL_FATAL_FAILURE, "shutdown"); + GRPC_CHANNEL_SHUTDOWN, "shutdown"); /* cancel subscription */ if (selected != NULL) { grpc_connected_subchannel_notify_on_state_change( @@ -273,11 +273,11 @@ static void pf_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg, } else if (selected != NULL) { if (p->checking_connectivity == GRPC_CHANNEL_TRANSIENT_FAILURE) { /* if the selected channel goes bad, we're done */ - p->checking_connectivity = GRPC_CHANNEL_FATAL_FAILURE; + p->checking_connectivity = GRPC_CHANNEL_SHUTDOWN; } grpc_connectivity_state_set(exec_ctx, &p->state_tracker, p->checking_connectivity, "selected_changed"); - if (p->checking_connectivity != GRPC_CHANNEL_FATAL_FAILURE) { + if (p->checking_connectivity != GRPC_CHANNEL_SHUTDOWN) { grpc_connected_subchannel_notify_on_state_change( exec_ctx, selected, p->base.interested_parties, &p->checking_connectivity, &p->connectivity_changed); @@ -343,7 +343,7 @@ static void pf_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg, p->base.interested_parties, &p->checking_connectivity, &p->connectivity_changed); break; - case GRPC_CHANNEL_FATAL_FAILURE: + case GRPC_CHANNEL_SHUTDOWN: p->num_subchannels--; GPR_SWAP(grpc_subchannel *, p->subchannels[p->checking_subchannel], p->subchannels[p->num_subchannels]); @@ -351,7 +351,7 @@ static void pf_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg, "pick_first"); if (p->num_subchannels == 0) { grpc_connectivity_state_set(exec_ctx, &p->state_tracker, - GRPC_CHANNEL_FATAL_FAILURE, + GRPC_CHANNEL_SHUTDOWN, "no_more_channels"); while ((pp = p->pending_picks)) { p->pending_picks = pp->next; diff --git a/src/core/ext/lb_policy/round_robin/round_robin.c b/src/core/ext/lb_policy/round_robin/round_robin.c index dcdc0c6285..7ab913b645 100644 --- a/src/core/ext/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/lb_policy/round_robin/round_robin.c @@ -243,7 +243,7 @@ static void rr_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { gpr_free(pp); } grpc_connectivity_state_set(exec_ctx, &p->state_tracker, - GRPC_CHANNEL_FATAL_FAILURE, "shutdown"); + GRPC_CHANNEL_SHUTDOWN, "shutdown"); for (i = 0; i < p->num_subchannels; i++) { subchannel_data *sd = p->subchannels[i]; grpc_subchannel_notify_on_state_change(exec_ctx, sd->subchannel, NULL, NULL, @@ -439,7 +439,7 @@ static void rr_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg, GRPC_CHANNEL_TRANSIENT_FAILURE, "connecting_transient_failure"); break; - case GRPC_CHANNEL_FATAL_FAILURE: + case GRPC_CHANNEL_SHUTDOWN: if (sd->ready_list_node != NULL) { remove_disconnected_sc_locked(p, sd->ready_list_node); sd->ready_list_node = NULL; @@ -455,7 +455,7 @@ static void rr_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg, unref = 1; if (p->num_subchannels == 0) { grpc_connectivity_state_set(exec_ctx, &p->state_tracker, - GRPC_CHANNEL_FATAL_FAILURE, + GRPC_CHANNEL_SHUTDOWN, "no_more_channels"); while ((pp = p->pending_picks)) { p->pending_picks = pp->next; diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index b6886a2201..d0403cc6a2 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -444,7 +444,7 @@ static void close_transport_locked(grpc_exec_ctx *exec_ctx, void *arg_ignored) { if (!t->closed) { t->closed = 1; - connectivity_state_set(exec_ctx, &t->global, GRPC_CHANNEL_FATAL_FAILURE, + connectivity_state_set(exec_ctx, &t->global, GRPC_CHANNEL_SHUTDOWN, "close_transport"); if (t->ep) { allow_endpoint_shutdown_locked(exec_ctx, t); @@ -804,7 +804,7 @@ void grpc_chttp2_add_incoming_goaway( gpr_free(msg); gpr_slice_unref(goaway_text); transport_global->seen_goaway = 1; - connectivity_state_set(exec_ctx, transport_global, GRPC_CHANNEL_FATAL_FAILURE, + connectivity_state_set(exec_ctx, transport_global, GRPC_CHANNEL_SHUTDOWN, "got_goaway"); } diff --git a/src/core/lib/surface/lame_client.c b/src/core/lib/surface/lame_client.c index 0f5a762364..eef862787f 100644 --- a/src/core/lib/surface/lame_client.c +++ b/src/core/lib/surface/lame_client.c @@ -91,8 +91,8 @@ static void lame_start_transport_op(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, grpc_transport_op *op) { if (op->on_connectivity_state_change) { - GPR_ASSERT(*op->connectivity_state != GRPC_CHANNEL_FATAL_FAILURE); - *op->connectivity_state = GRPC_CHANNEL_FATAL_FAILURE; + GPR_ASSERT(*op->connectivity_state != GRPC_CHANNEL_SHUTDOWN); + *op->connectivity_state = GRPC_CHANNEL_SHUTDOWN; op->on_connectivity_state_change->cb( exec_ctx, op->on_connectivity_state_change->cb_arg, 1); } diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index dab7e35748..9532e090a4 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -812,7 +812,7 @@ static void channel_connectivity_changed(grpc_exec_ctx *exec_ctx, void *cd, bool iomgr_status_ignored) { channel_data *chand = cd; grpc_server *server = chand->server; - if (chand->connectivity_state != GRPC_CHANNEL_FATAL_FAILURE) { + if (chand->connectivity_state != GRPC_CHANNEL_SHUTDOWN) { grpc_transport_op op; memset(&op, 0, sizeof(op)); op.on_connectivity_state_change = &chand->channel_connectivity_changed, diff --git a/src/core/lib/transport/connectivity_state.c b/src/core/lib/transport/connectivity_state.c index e24ee638fd..74a5ef5c13 100644 --- a/src/core/lib/transport/connectivity_state.c +++ b/src/core/lib/transport/connectivity_state.c @@ -51,7 +51,7 @@ const char *grpc_connectivity_state_name(grpc_connectivity_state state) { return "READY"; case GRPC_CHANNEL_TRANSIENT_FAILURE: return "TRANSIENT_FAILURE"; - case GRPC_CHANNEL_FATAL_FAILURE: + case GRPC_CHANNEL_SHUTDOWN: return "FATAL_FAILURE"; } GPR_UNREACHABLE_CODE(return "UNKNOWN"); @@ -72,8 +72,8 @@ void grpc_connectivity_state_destroy(grpc_exec_ctx *exec_ctx, while ((w = tracker->watchers)) { tracker->watchers = w->next; - if (GRPC_CHANNEL_FATAL_FAILURE != *w->current) { - *w->current = GRPC_CHANNEL_FATAL_FAILURE; + if (GRPC_CHANNEL_SHUTDOWN != *w->current) { + *w->current = GRPC_CHANNEL_SHUTDOWN; success = 1; } else { success = 0; @@ -153,7 +153,7 @@ void grpc_connectivity_state_set(grpc_exec_ctx *exec_ctx, if (tracker->current_state == state) { return; } - GPR_ASSERT(tracker->current_state != GRPC_CHANNEL_FATAL_FAILURE); + GPR_ASSERT(tracker->current_state != GRPC_CHANNEL_SHUTDOWN); tracker->current_state = state; while ((w = tracker->watchers) != NULL) { *w->current = tracker->current_state; diff --git a/src/node/ext/node_grpc.cc b/src/node/ext/node_grpc.cc index 6b6e42737b..f18ce01c6f 100644 --- a/src/node/ext/node_grpc.cc +++ b/src/node/ext/node_grpc.cc @@ -220,7 +220,7 @@ void InitConnectivityStateConstants(Local<Object> exports) { Nan::Set(channel_state, Nan::New("TRANSIENT_FAILURE").ToLocalChecked(), TRANSIENT_FAILURE); Local<Value> FATAL_FAILURE( - Nan::New<Uint32, uint32_t>(GRPC_CHANNEL_FATAL_FAILURE)); + Nan::New<Uint32, uint32_t>(GRPC_CHANNEL_SHUTDOWN)); Nan::Set(channel_state, Nan::New("FATAL_FAILURE").ToLocalChecked(), FATAL_FAILURE); } diff --git a/src/php/ext/grpc/php_grpc.c b/src/php/ext/grpc/php_grpc.c index 762c01385c..f4cb5b28cc 100644 --- a/src/php/ext/grpc/php_grpc.c +++ b/src/php/ext/grpc/php_grpc.c @@ -227,7 +227,7 @@ PHP_MINIT_FUNCTION(grpc) { GRPC_CHANNEL_TRANSIENT_FAILURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("Grpc\\CHANNEL_FATAL_FAILURE", - GRPC_CHANNEL_FATAL_FAILURE, + GRPC_CHANNEL_SHUTDOWN, CONST_CS | CONST_PERSISTENT); grpc_init_call(TSRMLS_C); diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi index d42c58050f..05b8886df7 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi @@ -208,7 +208,7 @@ cdef extern from "grpc/_cython/loader.h": GRPC_CHANNEL_CONNECTING GRPC_CHANNEL_READY GRPC_CHANNEL_TRANSIENT_FAILURE - GRPC_CHANNEL_FATAL_FAILURE + GRPC_CHANNEL_SHUTDOWN ctypedef struct grpc_metadata: const char *key diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi index c7539f0d49..47800c067d 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi @@ -33,7 +33,7 @@ class ConnectivityState: connecting = GRPC_CHANNEL_CONNECTING ready = GRPC_CHANNEL_READY transient_failure = GRPC_CHANNEL_TRANSIENT_FAILURE - fatal_failure = GRPC_CHANNEL_FATAL_FAILURE + fatal_failure = GRPC_CHANNEL_SHUTDOWN class ChannelArgKey: diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c index 013321ffc8..6943c93d4a 100644 --- a/src/ruby/ext/grpc/rb_channel.c +++ b/src/ruby/ext/grpc/rb_channel.c @@ -373,7 +373,7 @@ static void Init_grpc_connectivity_states() { rb_define_const(grpc_rb_mConnectivityStates, "TRANSIENT_FAILURE", LONG2NUM(GRPC_CHANNEL_TRANSIENT_FAILURE)); rb_define_const(grpc_rb_mConnectivityStates, "FATAL_FAILURE", - LONG2NUM(GRPC_CHANNEL_FATAL_FAILURE)); + LONG2NUM(GRPC_CHANNEL_SHUTDOWN)); } void Init_grpc_channel() { |