From 5c1351883e587c423220a9e1abb19a0413a73fdf Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 3 Mar 2023 07:54:06 -0800 Subject: [PATCH] WRR: add trace message when updating scheduler (#32534) This will help detect when we fall back to RR. --- .../lb_policy/weighted_round_robin/weighted_round_robin.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc index bcb76542b90..8f46025e255 100644 --- a/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/weighted_round_robin/weighted_round_robin.cc @@ -560,6 +560,13 @@ void WeightedRoundRobin::Picker::BuildSchedulerAndStartTimerLocked() { if (scheduler_or.has_value()) { scheduler = std::make_shared(std::move(*scheduler_or)); + if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + gpr_log(GPR_INFO, "[WRR %p picker %p] new scheduler: %p", wrr_.get(), + this, scheduler.get()); + } + } else if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + gpr_log(GPR_INFO, "[WRR %p picker %p] no scheduler, falling back to RR", + wrr_.get(), this); } { MutexLock lock(&scheduler_mu_);