Go to the documentation of this file.
25 #include "absl/status/status.h"
42 #define DEFAULT_POLL_INTERVAL_MS 5000
45 struct backup_poller {
68 "Declares the interval in ms between two backup polls on client channels. "
69 "These polls are run in the timer thread so that gRPC can process "
70 "connection failures while there is no active polling thread. "
71 "They help reconnect disconnected client channels (mostly due to "
72 "idleness), so that the next RPC on this channel won't fail. Set to 0 to "
73 "turn off the backup polls.");
79 if (poll_interval_ms < 0) {
81 "Invalid GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS: %d, "
82 "default value %" PRId64
" will be used.",
108 p->shutting_down =
true;
111 grpc_schedule_on_exec_ctx));
121 backup_poller*
p =
static_cast<backup_poller*
>(
arg);
130 if (
p->shutting_down) {
141 &
p->run_poller_closure);
146 g_poller = grpc_core::Zalloc<backup_poller>();
155 grpc_schedule_on_exec_ctx);
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)
size_t grpc_pollset_size(void)
GPRAPI void gpr_mu_unlock(gpr_mu *mu)
#define GPR_GLOBAL_CONFIG_GET(name)
static void g_poller_unref()
struct grpc_pollset_set grpc_pollset_set
static backup_poller * g_poller
GPRAPI void gpr_free(void *ptr)
static grpc_core::Duration g_poll_interval
grpc_error_handle grpc_pollset_work(grpc_pollset *pollset, grpc_pollset_worker **worker, grpc_core::Timestamp deadline)
#define GRPC_LOG_IF_ERROR(what, error)
#define GRPC_ERROR_CANCELLED
static void run_poller(void *arg, grpc_error_handle error)
void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu)
GPRAPI void gpr_once_init(gpr_once *once, void(*init_function)(void))
void grpc_client_channel_stop_backup_polling(grpc_pollset_set *interested_parties)
GPRAPI void * gpr_zalloc(size_t size)
bool grpc_iomgr_run_in_background()
std::vector< CordRep * > refs
static void backup_poller_shutdown_unref(backup_poller *p)
void grpc_pollset_set_del_pollset(grpc_pollset_set *pollset_set, grpc_pollset *pollset)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
GPRAPI void gpr_mu_init(gpr_mu *mu)
static void done_poller(void *arg, grpc_error_handle)
GPRAPI void gpr_mu_lock(gpr_mu *mu)
#define DEFAULT_POLL_INTERVAL_MS
static constexpr Duration Zero()
void grpc_client_channel_start_backup_polling(grpc_pollset_set *interested_parties)
void grpc_timer_cancel(grpc_timer *timer)
static constexpr Duration Milliseconds(int64_t millis)
constexpr int64_t millis() const
#define GRPC_ERROR_REF(err)
void grpc_pollset_shutdown(grpc_pollset *pollset, grpc_closure *closure)
static void g_poller_init_locked()
void grpc_timer_init(grpc_timer *timer, grpc_core::Timestamp deadline, grpc_closure *closure)
GPR_GLOBAL_CONFIG_DEFINE_INT32(grpc_client_channel_backup_poll_interval_ms, DEFAULT_POLL_INTERVAL_MS, "Declares the interval in ms between two backup polls on client channels. " "These polls are run in the timer thread so that gRPC can process " "connection failures while there is no active polling thread. " "They help reconnect disconnected client channels (mostly due to " "idleness), so that the next RPC on this channel won't fail. Set to 0 to " "turn off the backup polls.")
GPRAPI void gpr_ref_init(gpr_refcount *r, int n)
GPRAPI int gpr_unref(gpr_refcount *r)
static gpr_mu g_poller_mu
void grpc_pollset_destroy(grpc_pollset *pollset)
void grpc_pollset_set_add_pollset(grpc_pollset_set *pollset_set, grpc_pollset *pollset)
GPRAPI void gpr_ref(gpr_refcount *r)
#define GRPC_ERROR_IS_NONE(err)
void grpc_client_channel_global_init_backup_polling()
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:45