dns_resolver_cooldown_test.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #include <cstring>
20 #include <functional>
21 
22 #include <grpc/grpc.h>
24 #include <grpc/support/log.h>
25 
37 
38 constexpr int kMinResolutionPeriodMs = 1000;
39 
40 static std::shared_ptr<grpc_core::WorkSerializer>* g_work_serializer;
41 
42 static grpc_ares_request* (*g_default_dns_lookup_ares)(
43  const char* dns_server, const char* name, const char* default_port,
44  grpc_pollset_set* interested_parties, grpc_closure* on_done,
45  std::unique_ptr<grpc_core::ServerAddressList>* addresses,
46  std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses,
47  char** service_config_json, int query_timeout_ms);
48 
49 // Counter incremented by TestDNSResolver::ResolveName indicating the
50 // number of times a system-level resolution has happened.
51 static int g_resolution_count;
52 
53 static struct iomgr_args {
59 } g_iomgr_args;
60 
61 namespace {
62 
63 grpc_core::DNSResolver* g_default_dns_resolver;
64 
65 class TestDNSResolver : public grpc_core::DNSResolver {
66  public:
67  // Wrapper around default resolve_address in order to count the number of
68  // times we incur in a system-level name resolution.
69  TaskHandle ResolveName(
71  grpc_pollset_set* interested_parties,
72  std::function<void(absl::StatusOr<std::vector<grpc_resolved_address>>)>
73  on_done) override {
74  auto result = g_default_dns_resolver->ResolveName(
75  name, default_port, interested_parties, std::move(on_done));
77  static grpc_core::Timestamp last_resolution_time =
79  if (last_resolution_time == grpc_core::Timestamp::ProcessEpoch()) {
80  last_resolution_time = grpc_core::Timestamp::FromTimespecRoundUp(
82  } else {
85  GPR_ASSERT(now - last_resolution_time >=
87  last_resolution_time = now;
88  }
89  // For correct time diff comparisons, make sure that any subsequent calls
90  // to grpc_core::ExecCtx::Get()->Now() on this thread don't return a time
91  // which is earlier than that returned by the call(s) to
92  // gpr_now(GPR_CLOCK_MONOTONIC) within this function. This is important
93  // because the resolver's last_resolution_timestamp_ will be taken from
94  // grpc_core::ExecCtx::Get()->Now() right after this returns.
96  return result;
97  }
98 
100  absl::string_view name, absl::string_view default_port) override {
101  return g_default_dns_resolver->ResolveNameBlocking(name, default_port);
102  }
103 
104  // Not cancellable
105  bool Cancel(TaskHandle /*handle*/) override { return false; }
106 };
107 
108 } // namespace
109 
111  const char* dns_server, const char* name, const char* default_port,
112  grpc_pollset_set* /*interested_parties*/, grpc_closure* on_done,
113  std::unique_ptr<grpc_core::ServerAddressList>* addresses,
114  std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses,
115  char** service_config_json, int query_timeout_ms) {
117  dns_server, name, default_port, g_iomgr_args.pollset_set, on_done,
118  addresses, balancer_addresses, service_config_json, query_timeout_ms);
120  static auto last_resolution_time = grpc_core::Timestamp::ProcessEpoch();
121  auto now =
124  "last_resolution_time:%" PRId64 " now:%" PRId64
125  " min_time_between:%d",
126  last_resolution_time.milliseconds_after_process_epoch(),
127  now.milliseconds_after_process_epoch(), kMinResolutionPeriodMs);
128  if (last_resolution_time != grpc_core::Timestamp::ProcessEpoch()) {
129  GPR_ASSERT(now - last_resolution_time >=
131  }
132  last_resolution_time = now;
133  // For correct time diff comparisons, make sure that any subsequent calls
134  // to grpc_core::ExecCtx::Get()->Now() on this thread don't return a time
135  // which is earlier than that returned by the call(s) to
136  // gpr_now(GPR_CLOCK_MONOTONIC) within this function. This is important
137  // because the resolver's last_resolution_timestamp_ will be taken from
138  // grpc_core::ExecCtx::Get()->Now() right after this returns.
140  return result;
141 }
142 
145 }
146 
147 static void do_nothing(void* /*arg*/, grpc_error_handle /*error*/) {}
148 
150  gpr_event_init(&args->ev);
151  args->pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
152  grpc_pollset_init(args->pollset, &args->mu);
153  args->pollset_set = grpc_pollset_set_create();
154  grpc_pollset_set_add_pollset(args->pollset_set, args->pollset);
155  gpr_atm_rel_store(&args->done_atm, 0);
156 }
157 
160  grpc_pollset_set_del_pollset(args->pollset_set, args->pollset);
161  grpc_pollset_set_destroy(args->pollset_set);
162  grpc_closure do_nothing_cb;
163  GRPC_CLOSURE_INIT(&do_nothing_cb, do_nothing, nullptr,
164  grpc_schedule_on_exec_ctx);
165  gpr_mu_lock(args->mu);
166  grpc_pollset_shutdown(args->pollset, &do_nothing_cb);
167  gpr_mu_unlock(args->mu);
168  // exec_ctx needs to be flushed before calling grpc_pollset_destroy()
170  grpc_pollset_destroy(args->pollset);
171  gpr_free(args->pollset);
172 }
173 
177 }
178 
181  grpc_core::Timestamp deadline = n_sec_deadline(10);
182  while (true) {
183  bool done = gpr_atm_acq_load(&args->done_atm) != 0;
184  if (done) {
185  break;
186  }
187  grpc_core::Duration time_left = deadline - grpc_core::ExecCtx::Get()->Now();
188  gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRId64, done, time_left.millis());
189  GPR_ASSERT(time_left >= grpc_core::Duration::Zero());
190  grpc_pollset_worker* worker = nullptr;
191  gpr_mu_lock(args->mu);
192  GRPC_LOG_IF_ERROR("pollset_work", grpc_pollset_work(args->pollset, &worker,
193  n_sec_deadline(1)));
194  gpr_mu_unlock(args->mu);
196  }
197  gpr_event_set(&args->ev, reinterpret_cast<void*>(1));
198 }
199 
201 
203  public:
205 
207  GPR_ASSERT(result_cb_ == nullptr);
208  result_cb_ = result_cb;
209  GPR_ASSERT(state_ == nullptr);
210  state_ = state;
211  }
212 
213  void ReportResult(grpc_core::Resolver::Result /*result*/) override {
214  GPR_ASSERT(result_cb_ != nullptr);
215  GPR_ASSERT(state_ != nullptr);
218  result_cb_ = nullptr;
219  state_ = nullptr;
220  cb(state);
221  }
222 
223  private:
226 };
227 
229  const char* uri_str = nullptr;
232 };
233 
234 // Set to true by the last callback in the resolution chain.
236 
237 // It's interesting to run a few rounds of this test because as
238 // we run more rounds, the base starting time
239 // (i.e. ExecCtx g_start_time) gets further and further away
240 // from "Now()". Thus the more rounds ran, the more highlighted the
241 // difference is between absolute and relative times values.
243  gpr_log(GPR_INFO, "4th: g_resolution_count: %d", g_resolution_count);
245  cb_arg->resolver.reset();
248  GRPC_LOG_IF_ERROR("pollset_kick",
251  delete cb_arg;
253 }
254 
256  gpr_log(GPR_INFO, "3rd: g_resolution_count: %d", g_resolution_count);
259  cb_arg->resolver->RequestReresolutionLocked();
261  GRPC_LOG_IF_ERROR("pollset_kick",
264 }
265 
267  gpr_log(GPR_INFO, "2nd: g_resolution_count: %d", g_resolution_count);
268  // The resolution callback was not invoked until new data was
269  // available, which was delayed until after the cooldown period.
272  cb_arg->resolver->RequestReresolutionLocked();
274  GRPC_LOG_IF_ERROR("pollset_kick",
277 }
278 
280  gpr_log(GPR_INFO, "1st: g_resolution_count: %d", g_resolution_count);
281  // There's one initial system-level resolution and one invocation of a
282  // notification callback (the current function).
285  cb_arg->resolver->RequestReresolutionLocked();
287  GRPC_LOG_IF_ERROR("pollset_kick",
290 }
291 
293  OnResolutionCallbackArg* res_cb_arg =
294  static_cast<OnResolutionCallbackArg*>(arg);
295  res_cb_arg->result_handler = new ResultHandler();
298  .LookupResolverFactory("dns");
300  grpc_core::URI::Parse(res_cb_arg->uri_str);
301  gpr_log(GPR_DEBUG, "test: '%s' should be valid for '%s'", res_cb_arg->uri_str,
302  std::string(factory->scheme()).c_str());
303  if (!uri.ok()) {
304  gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
305  GPR_ASSERT(uri.ok());
306  }
308  args.uri = std::move(*uri);
309  args.work_serializer = *g_work_serializer;
310  args.result_handler = std::unique_ptr<grpc_core::Resolver::ResultHandler>(
311  res_cb_arg->result_handler);
312  g_resolution_count = 0;
313 
317  grpc_channel_args cooldown_args = {1, &cooldown_arg};
318  args.args = &cooldown_args;
319  res_cb_arg->resolver = factory->CreateResolver(std::move(args));
320  GPR_ASSERT(res_cb_arg->resolver != nullptr);
321  // First resolution, would incur in system-level resolution.
322  res_cb_arg->result_handler->SetCallback(on_first_resolution, res_cb_arg);
323  res_cb_arg->resolver->StartLocked();
324 }
325 
326 static void test_cooldown() {
330  res_cb_arg->uri_str = "dns:127.0.0.1";
331 
332  (*g_work_serializer)
333  ->Run([res_cb_arg]() { start_test_under_work_serializer(res_cb_arg); },
338 }
339 
340 int main(int argc, char** argv) {
341  grpc::testing::TestEnvironment env(&argc, argv);
342  grpc_init();
343 
344  auto work_serializer = std::make_shared<grpc_core::WorkSerializer>();
345  g_work_serializer = &work_serializer;
346 
349  g_default_dns_resolver = grpc_core::GetDNSResolver();
350  grpc_core::SetDNSResolver(new TestDNSResolver());
351 
352  test_cooldown();
353 
354  grpc_shutdown();
356  return 0;
357 }
grpc_pollset_worker
struct grpc_pollset_worker grpc_pollset_worker
Definition: pollset.h:39
GRPC_CLOSURE_INIT
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)
Definition: closure.h:115
grpc_arg
Definition: grpc_types.h:103
absl::time_internal::cctz::seconds
std::chrono::duration< std::int_fast64_t > seconds
Definition: abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h:40
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
g_resolution_count
static int g_resolution_count
Definition: dns_resolver_cooldown_test.cc:51
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
grpc_pollset_size
size_t grpc_pollset_size(void)
Definition: pollset.cc:56
gpr_mu_unlock
GPRAPI void gpr_mu_unlock(gpr_mu *mu)
now
static double now(void)
Definition: test/core/fling/client.cc:130
grpc_core::ResolverRegistry::LookupResolverFactory
ResolverFactory * LookupResolverFactory(absl::string_view scheme) const
Definition: resolver_registry.cc:108
OnResolutionCallbackArg::resolver
grpc_core::OrphanablePtr< grpc_core::Resolver > resolver
Definition: dns_resolver_cooldown_test.cc:230
grpc_timeout_seconds_to_deadline
gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s)
Definition: test/core/util/test_config.cc:81
log.h
core_configuration.h
sockaddr_utils.h
grpc_core::ResolverFactory::CreateResolver
virtual OrphanablePtr< Resolver > CreateResolver(ResolverArgs args) const =0
Returns a new resolver instance.
generate.env
env
Definition: generate.py:37
ResultHandler::SetCallback
void SetCallback(ResultCallback result_cb, OnResolutionCallbackArg *state)
Definition: dns_resolver_cooldown_test.cc:206
dns_server
Definition: dns_server.py:1
on_first_resolution
static void on_first_resolution(OnResolutionCallbackArg *cb_arg)
Definition: dns_resolver_cooldown_test.cc:279
grpc_pollset_set
struct grpc_pollset_set grpc_pollset_set
Definition: iomgr_fwd.h:23
grpc_core::DNSResolver
Definition: resolve_address.h:42
iomgr_args::mu
gpr_mu * mu
Definition: dns_resolver_cooldown_test.cc:56
g_default_dns_lookup_ares
static grpc_ares_request *(* g_default_dns_lookup_ares)(const char *dns_server, const char *name, const char *default_port, grpc_pollset_set *interested_parties, grpc_closure *on_done, std::unique_ptr< grpc_core::ServerAddressList > *addresses, std::unique_ptr< grpc_core::ServerAddressList > *balancer_addresses, char **service_config_json, int query_timeout_ms)
Definition: dns_resolver_cooldown_test.cc:42
iomgr_args::done_atm
gpr_atm done_atm
Definition: dns_resolver_cooldown_test.cc:55
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_pollset_set_create
grpc_pollset_set * grpc_pollset_set_create()
Definition: pollset_set.cc:29
grpc_core::Timestamp
Definition: src/core/lib/gprpp/time.h:62
gpr_event_set
GPRAPI void gpr_event_set(gpr_event *ev, void *value)
Definition: sync.cc:59
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
OnResolutionCallbackArg::result_handler
ResultHandler * result_handler
Definition: dns_resolver_cooldown_test.cc:231
resolve_address.h
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
test_dns_lookup_ares
static grpc_ares_request * test_dns_lookup_ares(const char *dns_server, const char *name, const char *default_port, grpc_pollset_set *, grpc_closure *on_done, std::unique_ptr< grpc_core::ServerAddressList > *addresses, std::unique_ptr< grpc_core::ServerAddressList > *balancer_addresses, char **service_config_json, int query_timeout_ms)
Definition: dns_resolver_cooldown_test.cc:110
iomgr_args_finish
static void iomgr_args_finish(iomgr_args *args)
Definition: dns_resolver_cooldown_test.cc:158
ResultHandler
Definition: dns_resolver_cooldown_test.cc:202
poll_pollset_until_request_done
static void poll_pollset_until_request_done(iomgr_args *args)
Definition: dns_resolver_cooldown_test.cc:179
setup.name
name
Definition: setup.py:542
iomgr_args::ev
gpr_event ev
Definition: dns_resolver_cooldown_test.cc:54
grpc_pollset_work
grpc_error_handle grpc_pollset_work(grpc_pollset *pollset, grpc_pollset_worker **worker, grpc_core::Timestamp deadline)
Definition: pollset.cc:45
GRPC_LOG_IF_ERROR
#define GRPC_LOG_IF_ERROR(what, error)
Definition: error.h:398
on_third_resolution
static void on_third_resolution(OnResolutionCallbackArg *cb_arg)
Definition: dns_resolver_cooldown_test.cc:255
grpc_core::URI::Parse
static absl::StatusOr< URI > Parse(absl::string_view uri_text)
Definition: uri_parser.cc:209
g_all_callbacks_invoked
static bool g_all_callbacks_invoked
Definition: dns_resolver_cooldown_test.cc:235
grpc_channel_args
Definition: grpc_types.h:132
grpc_pollset_init
void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu)
Definition: pollset.cc:33
start_test_under_work_serializer
static void start_test_under_work_serializer(void *arg)
Definition: dns_resolver_cooldown_test.cc:292
iomgr_args
Definition: dns_resolver_cooldown_test.cc:53
gpr_zalloc
GPRAPI void * gpr_zalloc(size_t size)
Definition: alloc.cc:40
test_cooldown
static void test_cooldown()
Definition: dns_resolver_cooldown_test.cc:326
memory.h
DEBUG_LOCATION
#define DEBUG_LOCATION
Definition: debug_location.h:41
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
iomgr_args_init
static void iomgr_args_init(iomgr_args *args)
Definition: dns_resolver_cooldown_test.cc:149
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc_pollset_set_del_pollset
void grpc_pollset_set_del_pollset(grpc_pollset_set *pollset_set, grpc_pollset *pollset)
Definition: pollset_set.cc:42
grpc_core::CoreConfiguration::Get
static const CoreConfiguration & Get()
Definition: core_configuration.h:82
grpc_core::ExecCtx::Flush
bool Flush()
Definition: exec_ctx.cc:69
grpc_ares_wrapper.h
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
worker
Definition: worker.py:1
OnResolutionCallbackArg::uri_str
const char * uri_str
Definition: dns_resolver_cooldown_test.cc:229
work_serializer.h
grpc_core::Resolver::Result
Results returned by the resolver.
Definition: resolver/resolver.h:56
grpc.h
grpc_pollset_set_destroy
void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set)
Definition: pollset_set.cc:33
gpr_atm_acq_load
#define gpr_atm_acq_load(p)
Definition: impl/codegen/atm_gcc_atomic.h:52
ResultHandler::result_cb_
ResultCallback result_cb_
Definition: dns_resolver_cooldown_test.cc:224
grpc_core::ResolverArgs
Definition: resolver_factory.h:41
done
struct tab * done
Definition: bloaty/third_party/zlib/examples/enough.c:176
arg
Definition: cmdline.cc:40
server_address.h
time.h
gpr_atm_rel_store
#define gpr_atm_rel_store(p, value)
Definition: impl/codegen/atm_gcc_atomic.h:54
GPR_CLOCK_MONOTONIC
@ GPR_CLOCK_MONOTONIC
Definition: gpr_types.h:36
gpr_mu_lock
GPRAPI void gpr_mu_lock(gpr_mu *mu)
gpr_event_init
GPRAPI void gpr_event_init(gpr_event *ev)
Definition: sync.cc:54
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
grpc_core::Resolver::ResultHandler
Definition: resolver/resolver.h:84
grpc_pollset_kick
grpc_error_handle grpc_pollset_kick(grpc_pollset *pollset, grpc_pollset_worker *specific_worker)
Definition: pollset.cc:51
grpc_core::Timestamp::ProcessEpoch
static constexpr Timestamp ProcessEpoch()
Definition: src/core/lib/gprpp/time.h:77
gpr_now
GPRAPI gpr_timespec gpr_now(gpr_clock_type clock)
grpc_core::ExecCtx
Definition: exec_ctx.h:97
gpr_event_wait
GPRAPI void * gpr_event_wait(gpr_event *ev, gpr_timespec abs_deadline)
Definition: sync.cc:73
resolver_registry.h
on_second_resolution
static void on_second_resolution(OnResolutionCallbackArg *cb_arg)
Definition: dns_resolver_cooldown_test.cc:266
gpr_types.h
iomgr_args::pollset
grpc_pollset * pollset
Definition: dns_resolver_cooldown_test.cc:57
g_work_serializer
static std::shared_ptr< grpc_core::WorkSerializer > * g_work_serializer
Definition: dns_resolver_cooldown_test.cc:40
grpc_ares_request
Definition: grpc_ares_wrapper.h:56
test_config.h
grpc_core::Duration::Zero
static constexpr Duration Zero()
Definition: src/core/lib/gprpp/time.h:130
gpr_atm
intptr_t gpr_atm
Definition: impl/codegen/atm_gcc_atomic.h:32
grpc_core::Duration::Milliseconds
static constexpr Duration Milliseconds(int64_t millis)
Definition: src/core/lib/gprpp/time.h:155
ResultHandler::ResultCallback
void(*)(OnResolutionCallbackArg *state) ResultCallback
Definition: dns_resolver_cooldown_test.cc:204
absl::StatusOr::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: abseil-cpp/absl/status/statusor.h:491
gpr_event
Definition: impl/codegen/sync_generic.h:31
grpc_core::Duration::millis
constexpr int64_t millis() const
Definition: src/core/lib/gprpp/time.h:208
grpc_channel_arg_integer_create
grpc_arg grpc_channel_arg_integer_create(char *name, int value)
Definition: channel_args.cc:484
gpr_mu
pthread_mutex_t gpr_mu
Definition: impl/codegen/sync_posix.h:47
grpc_core::GetDNSResolver
DNSResolver * GetDNSResolver()
Definition: resolve_address.cc:38
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
grpc_pollset_shutdown
void grpc_pollset_shutdown(grpc_pollset *pollset, grpc_closure *closure)
Definition: pollset.cc:37
GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS
#define GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS
Definition: grpc_types.h:266
grpc_core::OrphanablePtr
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:64
main
int main(int argc, char **argv)
Definition: dns_resolver_cooldown_test.cc:340
on_fourth_resolution
static void on_fourth_resolution(OnResolutionCallbackArg *cb_arg)
Definition: dns_resolver_cooldown_test.cc:242
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
ResultHandler::ReportResult
void ReportResult(grpc_core::Resolver::Result) override
Reports a result to the channel.
Definition: dns_resolver_cooldown_test.cc:213
n_sec_deadline
static grpc_core::Timestamp n_sec_deadline(int seconds)
Definition: dns_resolver_cooldown_test.cc:174
grpc_core::DNSResolver::ResolveName
virtual TaskHandle ResolveName(absl::string_view name, absl::string_view default_port, grpc_pollset_set *interested_parties, std::function< void(absl::StatusOr< std::vector< grpc_resolved_address >>)> on_done)=0
arg
struct arg arg
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
grpc_core::SetDNSResolver
void SetDNSResolver(DNSResolver *resolver)
Definition: resolve_address.cc:36
grpc_core::CoreConfiguration::resolver_registry
const ResolverRegistry & resolver_registry() const
Definition: core_configuration.h:157
grpc_dns_lookup_ares
grpc_ares_request *(* grpc_dns_lookup_ares)(const char *dns_server, const char *name, const char *default_port, grpc_pollset_set *interested_parties, grpc_closure *on_done, std::unique_ptr< grpc_core::ServerAddressList > *addresses, std::unique_ptr< grpc_core::ServerAddressList > *balancer_addresses, char **service_config_json, int query_timeout_ms)
OnResolutionCallbackArg
Definition: dns_resolver_cooldown_test.cc:228
channel_args.h
grpc_core::DNSResolver::Cancel
virtual bool Cancel(TaskHandle handle)=0
do_nothing
static void do_nothing(void *, grpc_error_handle)
Definition: dns_resolver_cooldown_test.cc:147
GPR_DEBUG
#define GPR_DEBUG
Definition: include/grpc/impl/codegen/log.h:55
ResultHandler::state_
OnResolutionCallbackArg * state_
Definition: dns_resolver_cooldown_test.cc:225
absl::StatusOr
Definition: abseil-cpp/absl/status/statusor.h:187
grpc_core::ExecCtx::Now
Timestamp Now()
Definition: exec_ctx.cc:90
gpr_timespec
Definition: gpr_types.h:50
grpc_core::ResolverFactory::scheme
virtual absl::string_view scheme() const =0
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
grpc_error
Definition: error_internal.h:42
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
grpc_core::Timestamp::FromTimespecRoundUp
static Timestamp FromTimespecRoundUp(gpr_timespec t)
Definition: src/core/lib/gprpp/time.cc:136
test_deadline
static gpr_timespec test_deadline(void)
Definition: dns_resolver_cooldown_test.cc:143
grpc_core::Duration
Definition: src/core/lib/gprpp/time.h:122
grpc_pollset
Definition: bm_cq_multiple_threads.cc:37
grpc_pollset_destroy
void grpc_pollset_destroy(grpc_pollset *pollset)
Definition: pollset.cc:41
iomgr_args::pollset_set
grpc_pollset_set * pollset_set
Definition: dns_resolver_cooldown_test.cc:58
grpc_closure
Definition: closure.h:56
grpc_pollset_set_add_pollset
void grpc_pollset_set_add_pollset(grpc_pollset_set *pollset_set, grpc_pollset *pollset)
Definition: pollset_set.cc:37
grpc_core::ResolverFactory
Definition: resolver_factory.h:54
kMinResolutionPeriodMs
constexpr int kMinResolutionPeriodMs
Definition: dns_resolver_cooldown_test.cc:38
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
grpc_core::DNSResolver::ResolveNameBlocking
virtual absl::StatusOr< std::vector< grpc_resolved_address > > ResolveNameBlocking(absl::string_view name, absl::string_view default_port)=0
g_iomgr_args
static struct iomgr_args g_iomgr_args
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351
grpc_core::ExecCtx::Get
static ExecCtx * Get()
Definition: exec_ctx.h:205
state
static struct rpc_state state
Definition: bad_server_response_test.cc:87
absl::StatusOr::status
const Status & status() const &
Definition: abseil-cpp/absl/status/statusor.h:678
grpc_core::ExecCtx::InvalidateNow
void InvalidateNow()
Definition: exec_ctx.h:188


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:17