diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 6a46a0bbc30..3b6e59b5f5a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -1259,12 +1259,10 @@ ServerAddressList ExtractBalancerAddresses(const grpc_channel_args& args) { * stream for the reception of load balancing updates. * * Inputs: - * - \a addresses: corresponding to the balancers. * - \a response_generator: in order to propagate updates from the resolver * above the grpclb policy. * - \a args: other args inherited from the grpclb policy. */ grpc_channel_args* BuildBalancerChannelArgs( - const ServerAddressList& addresses, FakeResolverResponseGenerator* response_generator, const grpc_channel_args* args) { // Channel args to remove. @@ -1313,7 +1311,7 @@ grpc_channel_args* BuildBalancerChannelArgs( args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), args_to_add.data(), args_to_add.size()); // Make any necessary modifications for security. - return ModifyGrpclbBalancerChannelArgs(addresses, new_args); + return ModifyGrpclbBalancerChannelArgs(new_args); } // @@ -1464,8 +1462,8 @@ void GrpcLb::ProcessAddressesAndChannelArgsLocked( &args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), &new_arg, 1); // Construct args for balancer channel. ServerAddressList balancer_addresses = ExtractBalancerAddresses(args); - grpc_channel_args* lb_channel_args = BuildBalancerChannelArgs( - balancer_addresses, response_generator_.get(), &args); + grpc_channel_args* lb_channel_args = + BuildBalancerChannelArgs(response_generator_.get(), &args); // Create balancer channel if needed. if (lb_channel_ == nullptr) { std::string uri_str = absl::StrCat("fake:///", server_name_); diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc index f8197a89bfb..07c5fd6fe9e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc @@ -24,8 +24,7 @@ namespace grpc_core { -grpc_channel_args* ModifyGrpclbBalancerChannelArgs( - const ServerAddressList& /*addresses*/, grpc_channel_args* args) { +grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args) { return args; } diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h index 1458233022f..8ea48852855 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h @@ -33,8 +33,7 @@ namespace grpc_core { /// Takes ownership of \a args. /// /// Caller takes ownership of the returned args. -grpc_channel_args* ModifyGrpclbBalancerChannelArgs( - const ServerAddressList& addresses, grpc_channel_args* args); +grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args); grpc_channel* CreateGrpclbBalancerChannel(const char* target_uri, const grpc_channel_args& args); diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc index 70e6dec18cf..d2a10296f5f 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc @@ -39,8 +39,7 @@ namespace grpc_core { -grpc_channel_args* ModifyGrpclbBalancerChannelArgs( - const ServerAddressList& /*addresses*/, grpc_channel_args* args) { +grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args) { absl::InlinedVector args_to_remove; absl::InlinedVector args_to_add; // Substitute the channel credentials with a version without call diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 8b114603e82..e930407f3f1 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -93,7 +93,7 @@ class Chttp2ServerListener : public Server::ListenerInterface { explicit ConfigFetcherWatcher(Chttp2ServerListener* listener) : listener_(listener) {} - void UpdateConfig(grpc_channel_args* /*args*/) override { + void UpdateConfig(grpc_channel_args* args) override { { MutexLock lock(&listener_->mu_); grpc_channel_args_destroy(listener_->args_); diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc index 4980b4eaeb7..3a3d6f371e5 100644 --- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc +++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc @@ -30,7 +30,7 @@ namespace { grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args, - grpc_error** error) { + grpc_error** /*error*/) { return args; } diff --git a/src/core/ext/xds/xds_api.cc b/src/core/ext/xds/xds_api.cc index 5420d947b3a..816b34e96e3 100644 --- a/src/core/ext/xds/xds_api.cc +++ b/src/core/ext/xds/xds_api.cc @@ -1389,8 +1389,8 @@ grpc_error* LdsResponseParseClient( grpc_error* LdsResponseParseServer( upb_arena* arena, const envoy_config_listener_v3_Listener* listener, - const std::string& listener_name, - const envoy_config_core_v3_Address* address, + const std::string& /*listener_name*/, + const envoy_config_core_v3_Address* /*address*/, XdsApi::LdsUpdate* lds_update) { lds_update->type = XdsApi::LdsUpdate::ListenerType::kTcpListener; // TODO(yashykt): Support filter chain match. diff --git a/src/core/lib/security/credentials/fake/fake_credentials.cc b/src/core/lib/security/credentials/fake/fake_credentials.cc index 7ad4d61809a..c439282ffb1 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.cc +++ b/src/core/lib/security/credentials/fake/fake_credentials.cc @@ -59,7 +59,7 @@ class grpc_fake_server_credentials final : public grpc_server_credentials { ~grpc_fake_server_credentials() override = default; grpc_core::RefCountedPtr - create_security_connector(const grpc_channel_args* args) override { + create_security_connector(const grpc_channel_args* /*args*/) override { return grpc_fake_server_security_connector_create(this->Ref()); } }; diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index e380e274b66..967f744cee4 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -513,7 +513,7 @@ grpc_resource_user* CreateDefaultResourceUser(const grpc_channel_args* args) { } RefCountedPtr CreateChannelzNode( - Server* /*server*/, const grpc_channel_args* args) { + const grpc_channel_args* args) { RefCountedPtr channelz_node; if (grpc_channel_args_find_bool(args, GRPC_ARG_ENABLE_CHANNELZ, GRPC_ENABLE_CHANNELZ_DEFAULT)) { @@ -534,7 +534,7 @@ RefCountedPtr CreateChannelzNode( Server::Server(const grpc_channel_args* args) : channel_args_(grpc_channel_args_copy(args)), default_resource_user_(CreateDefaultResourceUser(args)), - channelz_node_(CreateChannelzNode(this, args)) {} + channelz_node_(CreateChannelzNode(args)) {} Server::~Server() { grpc_channel_args_destroy(channel_args_); diff --git a/src/cpp/ext/filters/census/context.cc b/src/cpp/ext/filters/census/context.cc index f2d251c1833..cffa68d6f56 100644 --- a/src/cpp/ext/filters/census/context.cc +++ b/src/cpp/ext/filters/census/context.cc @@ -28,10 +28,8 @@ using ::opencensus::tags::TagMap; using ::opencensus::trace::Span; using ::opencensus::trace::SpanContext; -void GenerateServerContext(absl::string_view tracing, - absl::string_view /*stats*/, - absl::string_view /*primary_role*/, - absl::string_view method, CensusContext* context) { +void GenerateServerContext(absl::string_view tracing, absl::string_view method, + CensusContext* context) { // Destruct the current CensusContext to free the Span memory before // overwriting it below. context->~CensusContext(); diff --git a/src/cpp/ext/filters/census/context.h b/src/cpp/ext/filters/census/context.h index 0c945b5f361..55709963522 100644 --- a/src/cpp/ext/filters/census/context.h +++ b/src/cpp/ext/filters/census/context.h @@ -96,9 +96,8 @@ size_t ServerStatsDeserialize(const char* buf, size_t buf_size, // Deserialize the incoming SpanContext and generate a new server context based // on that. This new span will never be a root span. This should only be called // with a blank CensusContext as it overwrites it. -void GenerateServerContext(absl::string_view tracing, absl::string_view stats, - absl::string_view primary_role, - absl::string_view method, CensusContext* context); +void GenerateServerContext(absl::string_view tracing, absl::string_view method, + CensusContext* context); // Creates a new client context that is by default a new root context. // If the current context is the default context then the newly created diff --git a/src/cpp/ext/filters/census/server_filter.cc b/src/cpp/ext/filters/census/server_filter.cc index e01985e3fe3..61e28de635e 100644 --- a/src/cpp/ext/filters/census/server_filter.cc +++ b/src/cpp/ext/filters/census/server_filter.cc @@ -103,19 +103,8 @@ void CensusServerCallData::OnDoneRecvInitialMetadataCb(void* user_data, size_t tracing_str_len = GRPC_SLICE_IS_EMPTY(sml.tracing_slice) ? 0 : GRPC_SLICE_LENGTH(sml.tracing_slice); - const char* census_str = GRPC_SLICE_IS_EMPTY(sml.census_proto) - ? "" - : reinterpret_cast( - GRPC_SLICE_START_PTR(sml.census_proto)); - size_t census_str_len = GRPC_SLICE_IS_EMPTY(sml.census_proto) - ? 0 - : GRPC_SLICE_LENGTH(sml.census_proto); - GenerateServerContext(absl::string_view(tracing_str, tracing_str_len), - absl::string_view(census_str, census_str_len), - /*primary_role*/ "", calld->qualified_method_, - &calld->context_); - + calld->qualified_method_, &calld->context_); grpc_slice_unref_internal(sml.tracing_slice); grpc_slice_unref_internal(sml.census_proto); grpc_slice_unref_internal(sml.path); diff --git a/test/cpp/end2end/xds_end2end_test.cc b/test/cpp/end2end/xds_end2end_test.cc index 36b6c777ced..2f56706a94c 100644 --- a/test/cpp/end2end/xds_end2end_test.cc +++ b/test/cpp/end2end/xds_end2end_test.cc @@ -895,8 +895,7 @@ class AdsServiceImpl : public std::enable_shared_from_this { &subscription_state, &resource_state, update_queue) || ClientNeedsResourceUpdate(resource_type_state, resource_state, - client_resource_type_version, - &subscription_state)) { + client_resource_type_version)) { gpr_log(GPR_INFO, "ADS[%p]: Sending update for type=%s name=%s", this, request.type_url().c_str(), resource_name.c_str()); resources_added_to_response.emplace(resource_name); @@ -942,11 +941,9 @@ class AdsServiceImpl : public std::enable_shared_from_this { auto& resource_name_map = resource_type_state.resource_name_map; auto it = subscription_name_map.find(resource_name); if (it != subscription_name_map.end()) { - SubscriptionState& subscription_state = it->second; ResourceState& resource_state = resource_name_map[resource_name]; if (ClientNeedsResourceUpdate(resource_type_state, resource_state, - sent_state->resource_type_version, - &subscription_state)) { + sent_state->resource_type_version)) { gpr_log(GPR_INFO, "ADS[%p]: Sending update for type=%s name=%s", this, resource_type.c_str(), resource_name.c_str()); response->emplace(); @@ -1060,8 +1057,7 @@ class AdsServiceImpl : public std::enable_shared_from_this { // the resource. static bool ClientNeedsResourceUpdate( const ResourceTypeState& resource_type_state, - const ResourceState& resource_state, int client_resource_type_version, - SubscriptionState* /*subscription_state*/) { + const ResourceState& resource_state, int client_resource_type_version) { return client_resource_type_version < resource_type_state.resource_type_version && resource_state.resource_type_version <=