Skip to content

Commit 3027804

Browse files
committed
Sync c-core 1.72.0
1 parent e2dad3f commit 3027804

File tree

12 files changed

+42
-28
lines changed

12 files changed

+42
-28
lines changed

gRPC-C++.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Pod::Spec.new do |s|
2323
s.name = 'gRPC-C++'
2424
# TODO (mxyan): use version that match gRPC version when pod is stabilized
25-
version = '1.72.0-pre1'
25+
version = '1.72.0'
2626
s.version = version
2727
s.summary = 'gRPC C++ library'
2828
s.homepage = 'https://grpc.io'

gRPC-Core.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
Pod::Spec.new do |s|
2323
s.name = 'gRPC-Core'
24-
version = '1.72.0-pre1'
24+
version = '1.72.0'
2525
s.version = version
2626
s.summary = 'Core cross-platform gRPC library, written in C'
2727
s.homepage = 'https://grpc.io'

gRPC-ProtoRPC.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
Pod::Spec.new do |s|
2323
s.name = 'gRPC-ProtoRPC'
24-
version = '1.72.0-pre1'
24+
version = '1.72.0'
2525
s.version = version
2626
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
2727
s.homepage = 'https://grpc.io'

gRPC-RxLibrary.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
Pod::Spec.new do |s|
2323
s.name = 'gRPC-RxLibrary'
24-
version = '1.72.0-pre1'
24+
version = '1.72.0'
2525
s.version = version
2626
s.summary = 'Reactive Extensions library for iOS/OSX.'
2727
s.homepage = 'https://grpc.io'

gRPC.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
Pod::Spec.new do |s|
2222
s.name = 'gRPC'
23-
version = '1.72.0-pre1'
23+
version = '1.72.0'
2424
s.version = version
2525
s.summary = 'gRPC client library for iOS/OSX'
2626
s.homepage = 'https://grpc.io'

include/grpcpp/version_info.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define GRPC_CPP_VERSION_MAJOR 1
2222
#define GRPC_CPP_VERSION_MINOR 72
2323
#define GRPC_CPP_VERSION_PATCH 0
24-
#define GRPC_CPP_VERSION_TAG "pre1"
25-
#define GRPC_CPP_VERSION_STRING "1.72.0-pre1"
24+
#define GRPC_CPP_VERSION_TAG ""
25+
#define GRPC_CPP_VERSION_STRING "1.72.0"
2626

2727
#endif // GRPCPP_VERSION_INFO_H

src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,17 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::
395395
// reduce the check rate if the pool is idle.
396396
if (pool_->IsShutdown()) {
397397
if (pool_->IsQuiesced()) break;
398-
} else {
399-
lifeguard_should_shut_down_->WaitForNotificationWithTimeout(
400-
absl::Milliseconds(backoff_.NextAttemptDelay().millis()));
398+
if (MaybeStartNewThread()) {
399+
// A new thread needed to be spawned to handle the workload.
400+
// Wait just a small while before checking again to prevent a busy loop.
401+
backoff_.Reset();
402+
}
403+
// Sleep for a bit.
404+
pool_->work_signal()->WaitWithTimeout(backoff_.NextAttemptDelay());
405+
continue;
401406
}
407+
lifeguard_should_shut_down_->WaitForNotificationWithTimeout(
408+
absl::Milliseconds(backoff_.NextAttemptDelay().millis()));
402409
MaybeStartNewThread();
403410
}
404411
lifeguard_running_.store(false, std::memory_order_relaxed);
@@ -422,11 +429,11 @@ WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::~Lifeguard() {
422429
lifeguard_is_shut_down_ = std::make_unique<grpc_core::Notification>();
423430
}
424431

425-
void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::
432+
bool WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::
426433
MaybeStartNewThread() {
427434
// No new threads are started when forking.
428435
// No new work is done when forking needs to begin.
429-
if (pool_->forking_.load()) return;
436+
if (pool_->forking_.load()) return false;
430437
const auto living_thread_count = pool_->living_thread_count()->count();
431438
// Wake an idle worker thread if there's global work to be had.
432439
if (pool_->busy_thread_count()->count() < living_thread_count) {
@@ -435,7 +442,7 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::
435442
backoff_.Reset();
436443
}
437444
// Idle threads will eventually wake up for an attempt at work stealing.
438-
return;
445+
return false;
439446
}
440447
// No new threads if in the throttled state.
441448
// However, all workers are busy, so the Lifeguard should be more
@@ -445,7 +452,7 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::
445452
pool_->last_started_thread_) <
446453
kTimeBetweenThrottledThreadStarts) {
447454
backoff_.Reset();
448-
return;
455+
return false;
449456
}
450457
// All workers are busy and the pool is not throttled. Start a new thread.
451458
// TODO(hork): new threads may spawn when there is no work in the global
@@ -457,6 +464,7 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Lifeguard::
457464
pool_->StartThread();
458465
// Tell the lifeguard to monitor the pool more closely.
459466
backoff_.Reset();
467+
return true;
460468
}
461469

462470
// -------- WorkStealingThreadPool::ThreadState --------

src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ class WorkStealingThreadPool final : public ThreadPool {
158158
// The main body of the lifeguard thread.
159159
void LifeguardMain();
160160
// Starts a new thread if the pool is backlogged
161-
void MaybeStartNewThread();
161+
// Return true if a new thread was started.
162+
bool MaybeStartNewThread();
162163

163164
WorkStealingThreadPoolImpl* pool_;
164165
grpc_core::BackOff backoff_;

src/core/load_balancing/rls/rls.cc

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ class RlsLb final : public LoadBalancingPolicy {
401401
size_t Size() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
402402

403403
// Pick subchannel for request based on the entry's state.
404-
PickResult Pick(PickArgs args) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
404+
PickResult Pick(PickArgs args, absl::string_view lookup_service)
405+
ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
405406

406407
// If the cache entry is in backoff state, resets the backoff and, if
407408
// applicable, its backoff timer. The method does not update the LB
@@ -693,6 +694,7 @@ class RlsLb final : public LoadBalancingPolicy {
693694

694695
template <typename HandleType>
695696
void MaybeExportPickCount(HandleType handle, absl::string_view target,
697+
absl::string_view lookup_service,
696698
const PickResult& pick_result);
697699

698700
const std::string instance_uuid_;
@@ -1000,7 +1002,7 @@ LoadBalancingPolicy::PickResult RlsLb::Picker::Pick(PickArgs args) {
10001002
GRPC_TRACE_LOG(rls_lb, INFO)
10011003
<< "[rlslb " << lb_policy_.get() << "] picker=" << this
10021004
<< ": using cache entry " << entry;
1003-
return entry->Pick(args);
1005+
return entry->Pick(args, config_->lookup_service());
10041006
}
10051007
// If the entry is in backoff, then use the default target if set,
10061008
// or else fail the pick.
@@ -1026,7 +1028,8 @@ LoadBalancingPolicy::PickResult RlsLb::Picker::PickFromDefaultTargetOrFail(
10261028
<< reason << "; using default target";
10271029
auto pick_result = default_child_policy_->Pick(args);
10281030
lb_policy_->MaybeExportPickCount(kMetricDefaultTargetPicks,
1029-
config_->default_target(), pick_result);
1031+
config_->default_target(),
1032+
config_->lookup_service(), pick_result);
10301033
return pick_result;
10311034
}
10321035
GRPC_TRACE_LOG(rls_lb, INFO)
@@ -1137,7 +1140,8 @@ size_t RlsLb::Cache::Entry::Size() const {
11371140
return lb_policy_->cache_.EntrySizeForKey(*lru_iterator_);
11381141
}
11391142

1140-
LoadBalancingPolicy::PickResult RlsLb::Cache::Entry::Pick(PickArgs args) {
1143+
LoadBalancingPolicy::PickResult RlsLb::Cache::Entry::Pick(
1144+
PickArgs args, absl::string_view lookup_service) {
11411145
size_t i = 0;
11421146
ChildPolicyWrapper* child_policy_wrapper = nullptr;
11431147
// Skip targets before the last one that are in state TRANSIENT_FAILURE.
@@ -1167,7 +1171,8 @@ LoadBalancingPolicy::PickResult RlsLb::Cache::Entry::Pick(PickArgs args) {
11671171
<< "; delegating";
11681172
auto pick_result = child_policy_wrapper->Pick(args);
11691173
lb_policy_->MaybeExportPickCount(kMetricTargetPicks,
1170-
child_policy_wrapper->target(), pick_result);
1174+
child_policy_wrapper->target(),
1175+
lookup_service, pick_result);
11711176
// Add header data.
11721177
if (!header_data_.empty()) {
11731178
auto* complete_pick =
@@ -2114,6 +2119,7 @@ void RlsLb::UpdatePickerLocked() {
21142119

21152120
template <typename HandleType>
21162121
void RlsLb::MaybeExportPickCount(HandleType handle, absl::string_view target,
2122+
absl::string_view lookup_service,
21172123
const PickResult& pick_result) {
21182124
absl::string_view pick_result_string = Match(
21192125
pick_result.result,
@@ -2125,11 +2131,10 @@ void RlsLb::MaybeExportPickCount(HandleType handle, absl::string_view target,
21252131
[](const LoadBalancingPolicy::PickResult::Drop&) { return "drop"; });
21262132
if (pick_result_string.empty()) return; // Don't report queued picks.
21272133
auto& stats_plugins = channel_control_helper()->GetStatsPluginGroup();
2128-
stats_plugins.AddCounter(
2129-
handle, 1,
2130-
{channel_control_helper()->GetTarget(), config_->lookup_service(), target,
2131-
pick_result_string},
2132-
{});
2134+
stats_plugins.AddCounter(handle, 1,
2135+
{channel_control_helper()->GetTarget(),
2136+
lookup_service, target, pick_result_string},
2137+
{});
21332138
}
21342139

21352140
//

src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Pod::Spec.new do |s|
4242
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
4343
# before them.
4444
s.name = '!ProtoCompiler-gRPCCppPlugin'
45-
v = '1.72.0-pre1'
45+
v = '1.72.0'
4646
s.version = v
4747
s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.'
4848
s.description = <<-DESC

0 commit comments

Comments
 (0)