client_channel.h
Go to the documentation of this file.
1 //
2 // Copyright 2015 gRPC authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
18 #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
19 
21 
22 #include <stddef.h>
23 
24 #include <atomic>
25 #include <map>
26 #include <memory>
27 #include <set>
28 #include <string>
29 #include <utility>
30 
31 #include "absl/base/thread_annotations.h"
32 #include "absl/status/status.h"
33 #include "absl/strings/string_view.h"
34 #include "absl/types/optional.h"
35 
38 #include <grpc/support/atm.h>
39 
76 
77 //
78 // Client channel filter
79 //
80 
81 // A client channel is a channel that begins disconnected, and can connect
82 // to some endpoint on demand. If that endpoint disconnects, it will be
83 // connected to again later.
84 //
85 // Calls on a disconnected client channel are queued until a connection is
86 // established.
87 
88 // Channel arg key for server URI string.
89 #define GRPC_ARG_SERVER_URI "grpc.server_uri"
90 
91 // Channel arg containing a pointer to the ClientChannel object.
92 #define GRPC_ARG_CLIENT_CHANNEL "grpc.internal.client_channel"
93 
94 // Channel arg containing a pointer to the ServiceConfig object.
95 #define GRPC_ARG_SERVICE_CONFIG_OBJ "grpc.internal.service_config_obj"
96 
97 // Max number of batches that can be pending on a call at any given
98 // time. This includes one batch for each of the following ops:
99 // recv_initial_metadata
100 // send_initial_metadata
101 // recv_message
102 // send_message
103 // recv_trailing_metadata
104 // send_trailing_metadata
105 #define MAX_PENDING_BATCHES 6
106 
107 namespace grpc_core {
108 
110  public:
112 
113  class LoadBalancedCall;
114 
115  // Returns the ClientChannel object from channel, or null if channel
116  // is not a client channel.
118 
120 
121  // Starts a one-time connectivity state watch. When the channel's state
122  // becomes different from *state, sets *state to the new state and
123  // schedules on_complete. The watcher_timer_init callback is invoked as
124  // soon as the watch is actually started (i.e., after hopping into the
125  // client channel combiner). I/O will be serviced via pollent.
126  //
127  // This is intended to be used when starting a watch from outside of C-core
128  // via grpc_channel_watch_connectivity_state(). It should not be used
129  // by other callers.
132  grpc_closure* on_complete,
133  grpc_closure* watcher_timer_init) {
134  new ExternalConnectivityWatcher(this, pollent, state, on_complete,
135  watcher_timer_init);
136  }
137 
138  // Cancels a pending external watcher previously added by
139  // AddExternalConnectivityWatcher().
142  this, on_complete, /*cancel=*/true);
143  }
144 
147  return static_cast<int>(external_watchers_.size());
148  }
149 
150  // Starts and stops a connectivity watch. The watcher will be initially
151  // notified as soon as the state changes from initial_state and then on
152  // every subsequent state change until either the watch is stopped or
153  // it is notified that the state has changed to SHUTDOWN.
154  //
155  // This is intended to be used when starting watches from code inside of
156  // C-core (e.g., for a nested control plane channel for things like xds).
158  grpc_connectivity_state initial_state,
162 
165  grpc_closure* on_call_destruction_complete,
166  ConfigSelector::CallDispatchController* call_dispatch_controller,
167  bool is_transparent_retry);
168 
169  private:
170  class CallData;
171  class ResolverResultHandler;
172  class SubchannelWrapper;
173  class ClientChannelControlHelper;
174  class ConnectivityWatcherAdder;
175  class ConnectivityWatcherRemover;
176 
177  // Represents a pending connectivity callback from an external caller
178  // via grpc_client_channel_watch_connectivity_state().
180  public:
182  grpc_polling_entity pollent,
184  grpc_closure* on_complete,
185  grpc_closure* watcher_timer_init);
186 
187  ~ExternalConnectivityWatcher() override;
188 
189  // Removes the watcher from the external_watchers_ map.
191  grpc_closure* on_complete,
192  bool cancel);
193 
195  const absl::Status& /* status */) override;
196 
197  void Cancel();
198 
199  private:
200  // Adds the watcher to state_tracker_. Consumes the ref that is passed to it
201  // from Start().
202  void AddWatcherLocked()
204  void RemoveWatcherLocked()
206 
213  std::atomic<bool> done_{false};
214  };
215 
219  };
220  struct LbQueuedCall {
222  LbQueuedCall* next = nullptr;
223  };
224 
226  ~ClientChannel();
227 
228  // Filter vtable functions.
231  static void Destroy(grpc_channel_element* elem);
235  const grpc_channel_info* info);
236 
237  // Note: All methods with "Locked" suffix must be invoked from within
238  // work_serializer_.
239 
244 
247  const absl::optional<std::string>& health_check_service_name,
250  const grpc_channel_args& args)
252 
255  const char* reason,
256  std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker)
258 
260  RefCountedPtr<ServiceConfig> service_config,
261  RefCountedPtr<ConfigSelector> config_selector, std::string lb_policy_name)
263 
266 
270 
273 
276 
278 
279  // These methods all require holding resolution_mu_.
281  grpc_polling_entity* pollent)
284  grpc_polling_entity* pollent)
286 
287  // These methods all require holding data_plane_mu_.
290  void RemoveLbQueuedCall(LbQueuedCall* to_remove, grpc_polling_entity* pollent)
292 
293  //
294  // Fields set at construction and never modified.
295  //
303  channelz::ChannelNode* channelz_node_;
306 
307  //
308  // Fields related to name resolution. Guarded by resolution_mu_.
309  //
311  // Linked list of calls queued waiting for resolver result.
312  ResolverQueuedCall* resolver_queued_calls_ ABSL_GUARDED_BY(resolution_mu_) =
313  nullptr;
314  // Data from service config.
315  absl::Status resolver_transient_failure_error_
317  bool received_service_config_data_ ABSL_GUARDED_BY(resolution_mu_) = false;
319  RefCountedPtr<ConfigSelector> config_selector_
321  RefCountedPtr<DynamicFilters> dynamic_filters_
323 
324  //
325  // Fields used in the data plane. Guarded by data_plane_mu_.
326  //
328  std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker_
330  // Linked list of calls queued waiting for LB pick.
331  LbQueuedCall* lb_queued_calls_ ABSL_GUARDED_BY(data_plane_mu_) = nullptr;
332 
333  //
334  // Fields used in the control plane. Guarded by work_serializer.
335  //
339  bool previous_resolution_contained_addresses_
341  RefCountedPtr<ServiceConfig> saved_service_config_
343  RefCountedPtr<ConfigSelector> saved_config_selector_
347  RefCountedPtr<SubchannelPoolInterface> subchannel_pool_
349  // The number of SubchannelWrapper instances referencing a given Subchannel.
350  std::map<Subchannel*, int> subchannel_refcount_map_
352  // The set of SubchannelWrappers that currently exist.
353  // No need to hold a ref, since the map is updated in the control-plane
354  // work_serializer when the SubchannelWrappers are created and destroyed.
355  std::set<SubchannelWrapper*> subchannel_wrappers_
357  int keepalive_time_ ABSL_GUARDED_BY(*work_serializer_) = -1;
360 
361  //
362  // Fields guarded by a mutex, since they need to be accessed
363  // synchronously via get_channel_info().
364  //
366  std::string info_lb_policy_name_ ABSL_GUARDED_BY(info_mu_);
367  std::string info_service_config_json_ ABSL_GUARDED_BY(info_mu_);
368 
369  //
370  // Fields guarded by a mutex, since they need to be accessed
371  // synchronously via grpc_channel_num_external_connectivity_watchers().
372  //
375  external_watchers_ ABSL_GUARDED_BY(external_watchers_mu_);
376 };
377 
378 //
379 // ClientChannel::LoadBalancedCall
380 //
381 
382 // TODO(roth): As part of simplifying cancellation in the filter stack,
383 // this should no longer need to be ref-counted.
386  public:
388  public:
389  explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
390 
391  void* Alloc(size_t size) override { return lb_call_->arena_->Alloc(size); }
392 
393  // Internal API to allow first-party LB policies to access per-call
394  // attributes set by the ConfigSelector.
395  absl::string_view GetCallAttribute(UniqueTypeName type);
396 
397  private:
399  };
400 
401  // If on_call_destruction_complete is non-null, then it will be
402  // invoked once the LoadBalancedCall is completely destroyed.
403  // If it is null, then the caller is responsible for checking whether
404  // the LB call has a subchannel call and ensuring that the
405  // on_call_destruction_complete closure passed down from the surface
406  // is not invoked until after the subchannel call stack is destroyed.
409  grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete,
410  ConfigSelector::CallDispatchController* call_dispatch_controller,
411  bool is_transparent_retry);
412  ~LoadBalancedCall() override;
413 
414  void Orphan() override;
415 
416  void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
417 
418  // Invoked by channel for queued LB picks when the picker is updated.
419  static void PickSubchannel(void* arg, grpc_error_handle error);
420  // Helper function for performing an LB pick while holding the data plane
421  // mutex. Returns true if the pick is complete, in which case the caller
422  // must invoke PickDone() or AsyncPickDone() with the returned error.
423  bool PickSubchannelLocked(grpc_error_handle* error)
425  // Schedules a callback to process the completed pick. The callback
426  // will not run until after this method returns.
428 
430  return subchannel_call_;
431  }
432 
433  private:
434  class LbQueuedCallCanceller;
435  class Metadata;
436  class BackendMetricAccessor;
437 
438  // Returns the index into pending_batches_ to be used for batch.
439  static size_t GetBatchIndex(grpc_transport_stream_op_batch* batch);
440  void PendingBatchesAdd(grpc_transport_stream_op_batch* batch);
441  static void FailPendingBatchInCallCombiner(void* arg,
443  // A predicate type and some useful implementations for PendingBatchesFail().
444  typedef bool (*YieldCallCombinerPredicate)(
445  const CallCombinerClosureList& closures);
446  static bool YieldCallCombiner(const CallCombinerClosureList& /*closures*/) {
447  return true;
448  }
449  static bool NoYieldCallCombiner(const CallCombinerClosureList& /*closures*/) {
450  return false;
451  }
453  const CallCombinerClosureList& closures) {
454  return closures.size() > 0;
455  }
456  // Fails all pending batches.
457  // If yield_call_combiner_predicate returns true, assumes responsibility for
458  // yielding the call combiner.
459  void PendingBatchesFail(
461  YieldCallCombinerPredicate yield_call_combiner_predicate);
462  static void ResumePendingBatchInCallCombiner(void* arg,
463  grpc_error_handle ignored);
464  // Resumes all pending batches on subchannel_call_.
465  void PendingBatchesResume();
466 
467  static void SendInitialMetadataOnComplete(void* arg, grpc_error_handle error);
468  static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
469  static void RecvMessageReady(void* arg, grpc_error_handle error);
470  static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
471 
472  void RecordCallCompletion(absl::Status status);
473 
474  void CreateSubchannelCall();
475  // Invoked when a pick is completed, on both success or failure.
476  static void PickDone(void* arg, grpc_error_handle error);
477  // Removes the call from the channel's list of queued picks if present.
478  void MaybeRemoveCallFromLbQueuedCallsLocked()
480  // Adds the call to the channel's list of queued picks if not already present.
481  void MaybeAddCallToLbQueuedCallsLocked()
483 
485 
486  // TODO(roth): Instead of duplicating these fields in every filter
487  // that uses any one of them, we should store them in the call
488  // context. This will save per-call memory overhead.
489  Slice path_; // Request path.
496  grpc_closure* on_call_destruction_complete_;
497  ConfigSelector::CallDispatchController* call_dispatch_controller_;
498 
499  CallTracer::CallAttemptTracer* call_attempt_tracer_;
500 
501  gpr_cycle_counter lb_call_start_time_ = gpr_get_cycle_counter();
502 
503  // Set when we get a cancel_stream op.
505 
506  // Set when we fail inside the LB call.
508 
509  grpc_closure pick_closure_;
510 
511  // Accessed while holding ClientChannel::data_plane_mu_.
512  ClientChannel::LbQueuedCall queued_call_
514  bool queued_pending_lb_pick_ ABSL_GUARDED_BY(&ClientChannel::data_plane_mu_) =
515  false;
516  LbQueuedCallCanceller* lb_call_canceller_
518 
521  std::unique_ptr<LoadBalancingPolicy::SubchannelCallTrackerInterface>
522  lb_subchannel_call_tracker_;
523 
524  RefCountedPtr<SubchannelCall> subchannel_call_;
525 
526  // For intercepting send_initial_metadata on_complete.
527  gpr_atm* peer_string_ = nullptr;
528  grpc_closure send_initial_metadata_on_complete_;
529  grpc_closure* original_send_initial_metadata_on_complete_ = nullptr;
530 
531  // For intercepting recv_initial_metadata_ready.
535 
536  // For intercepting recv_message_ready.
537  absl::optional<SliceBuffer>* recv_message_ = nullptr;
540 
541  // For intercepting recv_trailing_metadata_ready.
543  grpc_transport_stream_stats* transport_stream_stats_ = nullptr;
546 
547  // Batches are added to this list when received from above.
548  // They are removed when we are done handling the batch (i.e., when
549  // either we have invoked all of the batch's callbacks or we have
550  // passed the batch down to the subchannel call and are not
551  // intercepting any of its callbacks).
553 };
554 
555 // A sub-class of ServiceConfigCallData used to access the
556 // CallDispatchController. Allocated on the arena, stored in the call
557 // context, and destroyed when the call is destroyed.
559  public:
561  RefCountedPtr<ServiceConfig> service_config,
562  const ServiceConfigParser::ParsedConfigVector* method_configs,
564  ConfigSelector::CallDispatchController* call_dispatch_controller,
565  grpc_call_context_element* call_context)
566  : ServiceConfigCallData(std::move(service_config), method_configs,
567  std::move(call_attributes)),
568  call_dispatch_controller_(call_dispatch_controller) {
569  call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
571  }
572 
574  return &call_dispatch_controller_;
575  }
576 
577  private:
578  // A wrapper for the CallDispatchController returned by the ConfigSelector.
579  // Handles the case where the ConfigSelector doees not return any
580  // CallDispatchController.
581  // Also ensures that we call Commit() at most once, which allows the
582  // client channel code to call Commit() when the call is complete in case
583  // it wasn't called earlier, without needing to know whether or not it was.
586  public:
588  ConfigSelector::CallDispatchController* call_dispatch_controller)
589  : call_dispatch_controller_(call_dispatch_controller) {}
590 
591  bool ShouldRetry() override {
592  if (call_dispatch_controller_ != nullptr) {
593  return call_dispatch_controller_->ShouldRetry();
594  }
595  return true;
596  }
597 
598  void Commit() override {
599  if (call_dispatch_controller_ != nullptr && !commit_called_) {
600  call_dispatch_controller_->Commit();
601  commit_called_ = true;
602  }
603  }
604 
605  private:
607  bool commit_called_ = false;
608  };
609 
610  static void Destroy(void* ptr) {
611  auto* self = static_cast<ClientChannelServiceConfigCallData*>(ptr);
612  self->~ClientChannelServiceConfigCallData();
613  }
614 
616 };
617 
618 } // namespace grpc_core
619 
620 #endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
grpc_core::ClientChannel::GetFromChannel
static ClientChannel * GetFromChannel(Channel *channel)
Definition: client_channel.cc:1009
grpc_core::CallCombinerClosureList
Definition: call_combiner.h:144
grpc_core::LoadBalancingPolicy::CallState
Definition: lb_policy.h:99
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
grpc_core::Channel
Definition: src/core/lib/surface/channel.h:108
slice.h
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
MAX_PENDING_BATCHES
#define MAX_PENDING_BATCHES
Definition: client_channel.h:105
grpc_core::ClientChannel::default_authority_
std::string default_authority_
Definition: client_channel.h:302
grpc_core::ClientChannel::ExternalConnectivityWatcher::Cancel
void Cancel()
Definition: client_channel.cc:776
grpc_core::ClientChannel::~ClientChannel
~ClientChannel()
Definition: client_channel.cc:1137
grpc_core::ClientChannelServiceConfigCallData::Destroy
static void Destroy(void *ptr)
Definition: client_channel.h:610
grpc_core::ClientChannel::RemoveResolverQueuedCall
void RemoveResolverQueuedCall(ResolverQueuedCall *to_remove, grpc_polling_entity *pollent) ABSL_EXCLUSIVE_LOCKS_REQUIRED(resolution_mu_)
Definition: client_channel.cc:1446
grpc_core::CallCombiner
Definition: call_combiner.h:50
grpc_core::ClientChannel::ExternalConnectivityWatcher::watcher_timer_init_
grpc_closure * watcher_timer_init_
Definition: client_channel.h:212
grpc_core::ClientChannel::ExternalConnectivityWatcher::RemoveWatcherFromExternalWatchersMap
static void RemoveWatcherFromExternalWatchersMap(ClientChannel *chand, grpc_closure *on_complete, bool cancel)
Definition: client_channel.cc:734
grpc_core::ClientChannel::uri_to_resolve_
std::string uri_to_resolve_
Definition: client_channel.h:301
orphanable.h
GRPC_ERROR_NONE
#define GRPC_ERROR_NONE
Definition: error.h:234
grpc_core::ConnectivityStateWatcherInterface
Definition: src/core/lib/transport/connectivity_state.h:49
metadata_batch.h
grpc_core::ConnectedSubchannel
Definition: subchannel.h:67
const
#define const
Definition: bloaty/third_party/zlib/zconf.h:230
bool
bool
Definition: setup_once.h:312
chand_
ClientChannel * chand_
Definition: client_channel.cc:321
deadline_
Timestamp deadline_
Definition: channel_connectivity.cc:163
grpc_core::ClientChannel::channel_args_
const grpc_channel_args * channel_args_
Definition: client_channel.h:299
grpc_channel_stack
Definition: channel_stack.h:202
channel_fwd.h
grpc_core::LoadBalancingPolicy
Definition: lb_policy.h:95
connectivity_state.h
grpc_core::ClientChannel::NumExternalConnectivityWatchers
int NumExternalConnectivityWatchers() const
Definition: client_channel.h:145
polling_entity.h
grpc_core::ClientChannel::work_serializer_
std::shared_ptr< WorkSerializer > work_serializer_
Definition: client_channel.h:336
grpc_core::ClientChannel::AddConnectivityWatcher
void AddConnectivityWatcher(grpc_connectivity_state initial_state, OrphanablePtr< AsyncConnectivityStateWatcherInterface > watcher)
Definition: client_channel.cc:1864
false
#define false
Definition: setup_once.h:323
grpc_core::ClientChannel::client_channel_factory_
ClientChannelFactory * client_channel_factory_
Definition: client_channel.h:298
grpc_core::ClientChannel::LoadBalancedCall::LbCallState
Definition: client_channel.h:387
grpc_core::ClientChannel::ExternalConnectivityWatcher::done_
std::atomic< bool > done_
Definition: client_channel.h:213
subchannel.h
grpc_core::ClientChannel::Init
static grpc_error_handle Init(grpc_channel_element *elem, grpc_channel_element_args *args)
Definition: client_channel.cc:1016
grpc_core::BackendMetricData
Definition: backend_metric_data.h:31
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::Slice
Definition: src/core/lib/slice/slice.h:282
grpc_core::MutexLock
Definition: src/core/lib/gprpp/sync.h:88
grpc_core::WorkSerializer
Definition: work_serializer.h:51
grpc_pollset_set
struct grpc_pollset_set grpc_pollset_set
Definition: iomgr_fwd.h:23
grpc_core::ClientChannel::ExternalConnectivityWatcher::AddWatcherLocked
void AddWatcherLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_ -> work_serializer_)
Definition: client_channel.cc:791
grpc_core::ClientChannel::LbQueuedCall
Definition: client_channel.h:220
grpc_core::ClientChannel::OnResolverErrorLocked
void OnResolverErrorLocked(absl::Status status) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1348
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::ServiceConfigCallData
Definition: service_config_call_data.h:41
grpc_core::Timestamp
Definition: src/core/lib/gprpp/time.h:62
grpc_channel_element
Definition: channel_stack.h:186
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
elem
Timer elem
Definition: event_engine/iomgr_event_engine/timer_heap_test.cc:109
error
grpc_error_handle error
Definition: retry_filter.cc:499
lb_policy.h
grpc_core::ClientChannel::ExternalConnectivityWatcher::RemoveWatcherLocked
void RemoveWatcherLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_ -> work_serializer_)
Definition: client_channel.cc:798
grpc_core::ClientChannel::ResolverQueuedCall::next
ResolverQueuedCall * next
Definition: client_channel.h:218
arena.h
grpc_core::ServiceConfigParser::ParsedConfigVector
std::vector< std::unique_ptr< ParsedConfig > > ParsedConfigVector
Definition: lib/service_config/service_config_parser.h:77
connected_subchannel_
RefCountedPtr< ConnectedSubchannel > connected_subchannel_
Definition: oob_backend_metric.cc:113
config_selector.h
closure.h
grpc_core::ClientChannel::ResolverQueuedCall
Definition: client_channel.h:216
subchannel_pool_interface.h
status
absl::Status status
Definition: rls.cc:251
grpc_core::ClientChannel::LoadBalancedCall::LbQueuedCallCanceller
Definition: client_channel.cc:3064
grpc_core::CallTracer
Definition: call_tracer.h:41
grpc_core::ClientChannel::ExternalConnectivityWatcher::Notify
void Notify(grpc_connectivity_state state, const absl::Status &) override
Definition: client_channel.cc:751
grpc_call_element
Definition: channel_stack.h:194
channelz.h
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:480
grpc_core::ClientChannel::LoadBalancedCall::AsyncPickDone
bool PickSubchannelLocked(grpc_error_handle *error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel voi AsyncPickDone)(grpc_error_handle error)
Definition: client_channel.h:427
grpc_core::Arena
Definition: src/core/lib/resource_quota/arena.h:45
grpc_core::ClientChannel::CreateLbPolicyLocked
OrphanablePtr< LoadBalancingPolicy > CreateLbPolicyLocked(const grpc_channel_args &args) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1417
grpc_channel_args
Definition: grpc_types.h:132
lb_call_
OrphanablePtr< ClientChannel::LoadBalancedCall > lb_call_
Definition: client_channel.cc:396
grpc_core::ClientChannel::AddResolverQueuedCall
void AddResolverQueuedCall(ResolverQueuedCall *call, grpc_polling_entity *pollent) ABSL_EXCLUSIVE_LOCKS_REQUIRED(resolution_mu_)
Definition: client_channel.cc:1436
grpc_core::ClientChannel::default_service_config_
RefCountedPtr< ServiceConfig > default_service_config_
Definition: client_channel.h:300
grpc_transport_op
Definition: transport.h:452
grpc_connectivity_state
grpc_connectivity_state
Definition: include/grpc/impl/codegen/connectivity_state.h:30
grpc_core::ClientChannel::service_config_parser_index_
const size_t service_config_parser_index_
Definition: client_channel.h:305
grpc_core::ClientChannelServiceConfigCallData::call_dispatch_controller
ConfigSelector::CallDispatchController * call_dispatch_controller()
Definition: client_channel.h:573
call
FilterStackCall * call
Definition: call.cc:750
grpc_core::CallCombinerClosureList::size
size_t size() const
Definition: call_combiner.h:195
grpc_core::ClientChannel::CheckConnectivityState
grpc_connectivity_state CheckConnectivityState(bool try_to_connect)
Definition: client_channel.cc:1848
grpc_types.h
grpc_core::ClientChannel::LoadBalancedCall::LbCallState::Alloc
void * Alloc(size_t size) override
Definition: client_channel.h:391
grpc_core::ClientChannel::UpdateStateAndPickerLocked
void UpdateStateAndPickerLocked(grpc_connectivity_state state, const absl::Status &status, const char *reason, std::unique_ptr< LoadBalancingPolicy::SubchannelPicker > picker) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1599
grpc_core::ClientChannel::ExternalConnectivityWatcher::chand_
ClientChannel * chand_
Definition: client_channel.h:207
backend_metric_data.h
grpc_core::ClientChannelFactory
Definition: client_channel_factory.h:32
context.h
grpc_core::ClientChannel::AddLbQueuedCall
void AddLbQueuedCall(LbQueuedCall *call, grpc_polling_entity *pollent) ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_)
Definition: client_channel.cc:1815
grpc_core::kUnrefCallDtor
@ kUnrefCallDtor
Definition: ref_counted.h:228
grpc_core::ClientChannel::ExternalConnectivityWatcher::on_complete_
grpc_closure * on_complete_
Definition: client_channel.h:211
grpc_core::ClientChannel::LoadBalancedCall
Definition: client_channel.h:384
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
grpc_core::ClientChannel::ExternalConnectivityWatcher::state_
grpc_connectivity_state * state_
Definition: client_channel.h:210
grpc_core::ClientChannelServiceConfigCallData::call_dispatch_controller_
CallDispatchControllerWrapper call_dispatch_controller_
Definition: client_channel.h:615
arena_
Arena * arena_
Definition: client_channel.cc:391
grpc_core::RefCountedPtr
Definition: ref_counted_ptr.h:35
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
grpc_core::ClientChannelServiceConfigCallData::CallDispatchControllerWrapper
Definition: client_channel.h:584
grpc_core::ClientChannel::ResolverQueuedCall::elem
grpc_call_element * elem
Definition: client_channel.h:217
grpc_core::ClientChannel::external_watchers_mu_
Mutex external_watchers_mu_
Definition: client_channel.h:373
grpc_core::Resolver
Definition: resolver/resolver.h:53
channel_stack.h
grpc_call_stack
Definition: channel_stack.h:233
work_serializer.h
ABSL_EXCLUSIVE_LOCKS_REQUIRED
#define ABSL_EXCLUSIVE_LOCKS_REQUIRED(...)
Definition: abseil-cpp/absl/base/thread_annotations.h:145
grpc_core::ClientChannel::LoadBalancedCall::NoYieldCallCombiner
static bool NoYieldCallCombiner(const CallCombinerClosureList &)
Definition: client_channel.h:449
grpc_core::Resolver::Result
Results returned by the resolver.
Definition: resolver/resolver.h:56
grpc_core::ClientChannel::channelz_node_
channelz::ChannelNode * channelz_node_
Definition: client_channel.h:303
grpc_core::ClientChannel::CreateLoadBalancedCall
OrphanablePtr< LoadBalancedCall > CreateLoadBalancedCall(const grpc_call_element_args &args, grpc_polling_entity *pollent, grpc_closure *on_call_destruction_complete, ConfigSelector::CallDispatchController *call_dispatch_controller, bool is_transparent_retry)
Definition: client_channel.cc:1150
grpc_core::ClientChannel::UpdateServiceConfigInControlPlaneLocked
void UpdateServiceConfigInControlPlaneLocked(RefCountedPtr< ServiceConfig > service_config, RefCountedPtr< ConfigSelector > config_selector, std::string lb_policy_name) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1460
connectivity_state.h
call_combiner.h
grpc_core::ClientChannel::ExternalConnectivityWatcher::ExternalConnectivityWatcher
ExternalConnectivityWatcher(ClientChannel *chand, grpc_polling_entity pollent, grpc_connectivity_state *state, grpc_closure *on_complete, grpc_closure *watcher_timer_init)
Definition: client_channel.cc:696
grpc_core::ClientChannel::ExternalConnectivityWatcher::~ExternalConnectivityWatcher
~ExternalConnectivityWatcher() override
Definition: client_channel.cc:726
recv_message_
grpc_byte_buffer * recv_message_
Definition: rls.cc:672
absl::optional< std::string >
grpc_core::ClientChannel::ExternalConnectivityWatcher
Definition: client_channel.h:179
grpc_core::ClientChannelServiceConfigCallData::CallDispatchControllerWrapper::call_dispatch_controller_
ConfigSelector::CallDispatchController * call_dispatch_controller_
Definition: client_channel.h:606
grpc_core::ServiceConfig
Definition: service_config.h:59
arg
Definition: cmdline.cc:40
service_config_call_data.h
time.h
call_combiner_
CallCombiner * call_combiner_
Definition: client_channel.cc:393
client_channel_factory.h
error.h
grpc_core::ClientChannel::TryToConnectLocked
void TryToConnectLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1839
grpc_core::ClientChannel::SubchannelWrapper
Definition: client_channel.cc:455
grpc_polling_entity
Definition: polling_entity.h:38
grpc_call_element_args
Definition: channel_stack.h:80
batch
grpc_transport_stream_op_batch * batch
Definition: retry_filter.cc:243
grpc_core::InternallyRefCounted
Definition: orphanable.h:73
grpc_core::ClientChannel::ExternalConnectivityWatcher::pollent_
grpc_polling_entity pollent_
Definition: client_channel.h:208
grpc_core::ClientChannel::UpdateServiceConfigInDataPlaneLocked
void UpdateServiceConfigInDataPlaneLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1485
grpc_core::ClientChannel::CreateResolverLocked
void CreateResolverLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1561
grpc_core::ClientChannel::StartTransportOp
static void StartTransportOp(grpc_channel_element *elem, grpc_transport_op *op)
Definition: client_channel.cc:1785
call_tracer.h
grpc_core::ClientChannel::Destroy
static void Destroy(grpc_channel_element *elem)
Definition: client_channel.cc:1025
peer_string_
gpr_atm * peer_string_
Definition: retry_filter.cc:622
grpc_core::ClientChannel::GetChannelInfo
static void GetChannelInfo(grpc_channel_element *elem, const grpc_channel_info *info)
Definition: client_channel.cc:1802
grpc_core::ClientChannel::LoadBalancedCall::LbCallState::LbCallState
LbCallState(LoadBalancedCall *lb_call)
Definition: client_channel.h:389
grpc_core::ServiceConfigCallData::CallAttributes
std::map< UniqueTypeName, absl::string_view > CallAttributes
Definition: service_config_call_data.h:43
grpc_channel_filter
Definition: channel_stack.h:111
grpc_core::ClientChannel::data_plane_mu_
Mutex data_plane_mu_
Definition: client_channel.h:327
service_config_parser.h
resolver.h
recv_trailing_metadata_
grpc_metadata_array recv_trailing_metadata_
Definition: rls.cc:673
grpc_core::ClientChannel::ClientChannel
ClientChannel(grpc_channel_element_args *args, grpc_error_handle *error)
Definition: client_channel.cc:1049
grpc_core::ClientChannel::RemoveLbQueuedCall
void RemoveLbQueuedCall(LbQueuedCall *to_remove, grpc_polling_entity *pollent) ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_)
Definition: client_channel.cc:1825
grpc_call_context_element::value
void * value
Definition: core/lib/channel/context.h:52
grpc_core::ClientChannel::AddExternalConnectivityWatcher
void AddExternalConnectivityWatcher(grpc_polling_entity pollent, grpc_connectivity_state *state, grpc_closure *on_complete, grpc_closure *watcher_timer_init)
Definition: client_channel.h:130
grpc_core::ConfigSelector::CallDispatchController
Definition: config_selector.h:51
grpc_core::ClientChannelServiceConfigCallData::CallDispatchControllerWrapper::Commit
void Commit() override
Definition: client_channel.h:598
gpr_atm
intptr_t gpr_atm
Definition: impl/codegen/atm_gcc_atomic.h:32
original_recv_initial_metadata_ready_
grpc_closure * original_recv_initial_metadata_ready_
Definition: message_decompress_filter.cc:115
grpc_core::ClientChannel::LbQueuedCall::next
LbQueuedCall * next
Definition: client_channel.h:222
grpc_core::Mutex
Definition: src/core/lib/gprpp/sync.h:61
picker_
std::unique_ptr< SubchannelPicker > picker_
Definition: outlier_detection.cc:323
grpc_core::Subchannel
Definition: subchannel.h:166
grpc_core::SliceBuffer
Definition: src/core/lib/slice/slice_buffer.h:44
grpc_core::UniqueTypeName
Definition: unique_type_name.h:56
grpc_core::SubchannelPoolInterface
Definition: subchannel_pool_interface.h:76
grpc_core::ClientChannel::deadline_checking_enabled_
const bool deadline_checking_enabled_
Definition: client_channel.h:296
path_
grpc_slice path_
Definition: client_channel.cc:389
recv_initial_metadata_ready_
grpc_closure recv_initial_metadata_ready_
Definition: retry_filter.cc:464
ref_counted.h
grpc_core::DynamicFilters
Definition: dynamic_filters.h:43
grpc_transport_stream_stats
Definition: transport.h:249
grpc_core::ConfigSelector
Definition: config_selector.h:48
GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA
@ GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA
Holds a pointer to ServiceConfigCallData associated with this call.
Definition: core/lib/channel/context.h:46
grpc_core::ClientChannel::DestroyResolverAndLbPolicyLocked
void DestroyResolverAndLbPolicyLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1580
absl::Status
Definition: third_party/abseil-cpp/absl/status/status.h:424
service_config_
RefCountedPtr< ServiceConfig > service_config_
Definition: service_config_channel_arg_filter.cc:76
grpc_core::ClientChannel::StartTransportOpLocked
void StartTransportOpLocked(grpc_transport_op *op) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1727
call_context_
grpc_call_context_element * call_context_
Definition: client_channel.cc:394
grpc_core::OrphanablePtr
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:64
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
backend_metric_data_
BackendMetricData backend_metric_data_
Definition: oob_backend_metric.cc:278
grpc_call_context_element
Definition: core/lib/channel/context.h:51
grpc_core::ClientChannel::ABSL_GUARDED_BY
ResolverQueuedCall *resolver_queued_calls_ ABSL_GUARDED_BY(resolution_mu_)
grpc_core::ClientChannelServiceConfigCallData::ClientChannelServiceConfigCallData
ClientChannelServiceConfigCallData(RefCountedPtr< ServiceConfig > service_config, const ServiceConfigParser::ParsedConfigVector *method_configs, ServiceConfigCallData::CallAttributes call_attributes, ConfigSelector::CallDispatchController *call_dispatch_controller, grpc_call_context_element *call_context)
Definition: client_channel.h:560
recv_trailing_metadata_ready_
grpc_closure recv_trailing_metadata_ready_
Definition: retry_filter.cc:473
dynamic_filters.h
grpc::protobuf::util::Status
GRPC_CUSTOM_UTIL_STATUS Status
Definition: include/grpcpp/impl/codegen/config_protobuf.h:93
grpc_core::ClientChannel
Definition: client_channel.h:109
cpp.gmock_class.set
set
Definition: bloaty/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class.py:44
grpc_core::ClientChannelServiceConfigCallData
Definition: client_channel.h:558
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
grpc_core::ClientChannel::LoadBalancedCall::YieldCallCombinerIfPendingBatchesFound
static bool YieldCallCombinerIfPendingBatchesFound(const CallCombinerClosureList &closures)
Definition: client_channel.h:452
grpc_core::ClientChannel::RemoveConnectivityWatcher
void RemoveConnectivityWatcher(AsyncConnectivityStateWatcherInterface *watcher)
Definition: client_channel.cc:1870
channelz
void channelz(grpc_end2end_test_config config)
Definition: test/core/end2end/tests/channelz.cc:318
resolver_
OrphanablePtr< Resolver > resolver_
Definition: xds_cluster_resolver.cc:291
unique_type_name.h
pending_batches_
PendingBatch pending_batches_[MAX_PENDING_BATCHES]
Definition: retry_filter.cc:595
ref_counted_ptr.h
grpc_core::ClientChannel::CreateOrUpdateLbPolicyLocked
void CreateOrUpdateLbPolicyLocked(RefCountedPtr< LoadBalancingPolicy::Config > lb_policy_config, const absl::optional< std::string > &health_check_service_name, Resolver::Result result) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1382
grpc_core::ClientChannel::kFilterVtable
static const grpc_channel_filter kFilterVtable
Definition: client_channel.h:111
transport.h
grpc_call_context_element::destroy
void(* destroy)(void *)
Definition: core/lib/channel/context.h:53
watcher
ClusterWatcher * watcher
Definition: cds.cc:148
grpc_core::ClientChannel::CancelExternalConnectivityWatcher
void CancelExternalConnectivityWatcher(grpc_closure *on_complete)
Definition: client_channel.h:140
cancel
bool cancel
Definition: client_callback_end2end_test.cc:634
grpc_core::SubchannelCall
Definition: subchannel.h:96
grpc_core::ClientChannel::ExternalConnectivityWatcher::initial_state_
grpc_connectivity_state initial_state_
Definition: client_channel.h:209
grpc_core::ClientChannel::interested_parties_
grpc_pollset_set * interested_parties_
Definition: client_channel.h:304
grpc_core::ClientChannel::LoadBalancedCall::LbCallState::lb_call_
LoadBalancedCall * lb_call_
Definition: client_channel.h:398
grpc_core::ClientChannel::OnResolverResultChangedLocked
void OnResolverResultChangedLocked(Resolver::Result result) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1222
service_config.h
grpc_channel_element_args
Definition: channel_stack.h:74
absl
Definition: abseil-cpp/absl/algorithm/algorithm.h:31
grpc_binder::Metadata
std::vector< std::pair< std::string, std::string > > Metadata
Definition: transaction.h:38
grpc_core::ClientChannel::info_mu_
Mutex info_mu_
Definition: client_channel.h:365
atm.h
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
iomgr_fwd.h
tests.unit._exit_scenarios.try_to_connect
try_to_connect
Definition: _exit_scenarios.py:189
grpc_error
Definition: error_internal.h:42
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
grpc_metadata_batch
Definition: metadata_batch.h:1259
grpc_core::ClientChannel::resolution_mu_
Mutex resolution_mu_
Definition: client_channel.h:310
grpc_core::ConnectivityStateTracker
Definition: src/core/lib/transport/connectivity_state.h:97
original_recv_message_ready_
grpc_closure * original_recv_message_ready_
Definition: message_decompress_filter.cc:124
grpc_channel_info
Definition: grpc_types.h:720
lb_policy_
RefCountedPtr< GrpcLb > lb_policy_
Definition: grpclb.cc:291
grpc_core::AsyncConnectivityStateWatcherInterface
Definition: src/core/lib/transport/connectivity_state.h:64
grpc_core::ClientChannel::LbQueuedCall::lb_call
LoadBalancedCall * lb_call
Definition: client_channel.h:221
grpc_transport_stream_op_batch
Definition: transport.h:284
recv_message_ready_
grpc_closure recv_message_ready_
Definition: retry_filter.cc:467
grpc_closure
Definition: closure.h:56
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
slice_buffer.h
grpc_core::ClientChannel::DoPingLocked
grpc_error_handle DoPingLocked(grpc_transport_op *op) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*work_serializer_)
Definition: client_channel.cc:1691
recv_initial_metadata_
grpc_metadata_array recv_initial_metadata_
Definition: rls.cc:671
grpc_core::ClientChannel::owning_stack_
grpc_channel_stack * owning_stack_
Definition: client_channel.h:297
sync.h
grpc_core::ClientChannel::LoadBalancedCall::subchannel_call
RefCountedPtr< SubchannelCall > subchannel_call() const
Definition: client_channel.h:429
grpc_core::ClientChannel::LoadBalancedCall::YieldCallCombiner
static bool YieldCallCombiner(const CallCombinerClosureList &)
Definition: client_channel.h:446
pollent_
grpc_polling_entity pollent_
Definition: google_c2p_resolver.cc:135
owning_call_
grpc_call_stack * owning_call_
Definition: client_channel.cc:392
original_recv_trailing_metadata_ready_
grpc_closure * original_recv_trailing_metadata_ready_
Definition: message_decompress_filter.cc:128
grpc_core::ClientChannelServiceConfigCallData::CallDispatchControllerWrapper::ShouldRetry
bool ShouldRetry() override
Definition: client_channel.h:591
channel.h
time_precise.h
port_platform.h
grpc_core::ClientChannelServiceConfigCallData::CallDispatchControllerWrapper::CallDispatchControllerWrapper
CallDispatchControllerWrapper(ConfigSelector::CallDispatchController *call_dispatch_controller)
Definition: client_channel.h:587


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:47