Go to the documentation of this file.
25 #include "absl/status/status.h"
26 #include "absl/status/statusor.h"
27 #include "absl/strings/string_view.h"
28 #include "absl/strings/strip.h"
45 Duration min_time_between_resolutions,
48 : authority_(
args.uri.authority()),
55 min_time_between_resolutions_(min_time_between_resolutions),
56 backoff_(backoff_options) {
98 self->work_serializer_->Run(
105 "[polling resolver %p] re-resolution timer fired: error=\"%s\", "
130 if (
result.service_config.ok() &&
result.addresses.ok()) {
137 "[polling resolver %p] resolution failed (will retry): "
138 "address status \"%s\"; service config status \"%s\"",
139 this,
result.addresses.status().ToString().c_str(),
140 result.service_config.status().ToString().c_str());
177 const Timestamp earliest_next_resolution =
179 const Duration time_until_next_resolution =
183 const Duration last_resolution_ago =
186 "[polling resolver %p] in cooldown from last resolution "
187 "(from %" PRId64
" ms ago); will resolve again in %" PRId64
189 this, last_resolution_ago.
millis(),
190 time_until_next_resolution.
millis());
208 gpr_log(
GPR_INFO,
"[polling resolver %p] starting resolution, request_=%p",
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)
const grpc_channel_args * channel_args_
channel args
void StartLocked() override
Starts resolving.
grpc_timer next_resolution_timer_
Timestamp NextAttemptTime()
Returns the time at which the next attempt should start.
std::shared_ptr< WorkSerializer > work_serializer_
OrphanablePtr< Orphanable > request_
are we currently resolving?
void OnNextResolutionLocked(grpc_error_handle error)
static void OnNextResolution(void *arg, grpc_error_handle error)
virtual OrphanablePtr< Orphanable > StartRequest()=0
PollingResolver(ResolverArgs args, const grpc_channel_args *channel_args, Duration min_time_between_resolutions, BackOff::Options backoff_options, TraceFlag *tracer)
void RequestReresolutionLocked() override
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
def c_str(s, encoding='ascii')
RefCountedPtr< Resolver > Ref() GRPC_MUST_USE_RESULT
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
const grpc_channel_args * channel_args_
Results returned by the resolver.
BackOff backoff_
retry backoff state
void grpc_channel_args_destroy(grpc_channel_args *a)
void MaybeStartResolvingLocked()
grpc_channel_args * grpc_channel_args_copy(const grpc_channel_args *src)
void OnRequestComplete(Result result)
std::unique_ptr< ResultHandler > result_handler_
Duration min_time_between_resolutions_
min time between DNS requests
void ResetBackoffLocked() override
static constexpr Duration Zero()
void grpc_timer_cancel(grpc_timer *timer)
ABSL_NAMESPACE_BEGIN Time Now()
constexpr int64_t millis() const
#define GRPC_ERROR_REF(err)
std::unique_ptr< ResultHandler > result_handler_
void StartResolvingLocked()
~PollingResolver() override
std::string grpc_error_std_string(grpc_error_handle error)
grpc_closure on_next_resolution_
void grpc_timer_init(grpc_timer *timer, grpc_core::Timestamp deadline, grpc_closure *closure)
#define GRPC_ERROR_UNREF(err)
absl::optional< Timestamp > last_resolution_timestamp_
timestamp of last DNS request
void ShutdownLocked() override
Shuts down the resolver.
std::shared_ptr< WorkSerializer > work_serializer_
void OnRequestCompleteLocked(Result result)
bool shutdown_
are we shutting down?
bool have_next_resolution_timer_
next resolution timer
grpc_pollset_set * interested_parties_
#define GRPC_ERROR_IS_NONE(err)
bool StripPrefix(std::string *name, const std::string &prefix)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:44