grpc 1.49.0.pre1 → 1.49.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +2 -2
- data/src/core/ext/filters/client_channel/client_channel.cc +8 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +2 -7
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +3 -0
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +25 -3
- data/src/core/lib/event_engine/forkable.cc +19 -16
- data/src/core/lib/iomgr/resolve_address_posix.cc +4 -0
- data/src/core/lib/iomgr/resolve_address_windows.cc +4 -0
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77badbf41d7178ac922baf03e49299a7abda2ff5b3030e52d11ea4479444626a
|
4
|
+
data.tar.gz: 22fc4c38a468d74f21049da7c3e75edc64c99e0bd4aa13f6e27c9abeb88e525b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa67e6b0ffa46e81eab1dc24b1c12dd9df27759429c09b3f3c3da436232172c9c5e2455dbabcb2a34bdf5e4b2c9f40b98838d4d12da307e49170d370bb54d4fc
|
7
|
+
data.tar.gz: 4c569deee6b977c215b7e36a17730a011114cc0d9556c8c38d778ec913ac33e95e75b36e2574d3dffcc6a3e1b13dc50229a025d6f15408eb74b702dadc0fb21a
|
data/Makefile
CHANGED
@@ -454,8 +454,8 @@ Q = @
|
|
454
454
|
endif
|
455
455
|
|
456
456
|
CORE_VERSION = 27.0.0
|
457
|
-
CPP_VERSION = 1.49.
|
458
|
-
CSHARP_VERSION = 2.49.
|
457
|
+
CPP_VERSION = 1.49.1
|
458
|
+
CSHARP_VERSION = 2.49.1
|
459
459
|
|
460
460
|
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
|
461
461
|
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
|
@@ -737,10 +737,14 @@ void ClientChannel::ExternalConnectivityWatcher::Notify(
|
|
737
737
|
// Hop back into the work_serializer to clean up.
|
738
738
|
// Not needed in state SHUTDOWN, because the tracker will
|
739
739
|
// automatically remove all watchers in that case.
|
740
|
+
// Note: The callback takes a ref in case the ref inside the state tracker
|
741
|
+
// gets removed before the callback runs via a SHUTDOWN notification.
|
740
742
|
if (state != GRPC_CHANNEL_SHUTDOWN) {
|
743
|
+
Ref(DEBUG_LOCATION, "RemoveWatcherLocked()").release();
|
741
744
|
chand_->work_serializer_->Run(
|
742
745
|
[this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
|
743
746
|
RemoveWatcherLocked();
|
747
|
+
Unref(DEBUG_LOCATION, "RemoveWatcherLocked()");
|
744
748
|
},
|
745
749
|
DEBUG_LOCATION);
|
746
750
|
}
|
@@ -754,9 +758,13 @@ void ClientChannel::ExternalConnectivityWatcher::Cancel() {
|
|
754
758
|
}
|
755
759
|
ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_CANCELLED);
|
756
760
|
// Hop back into the work_serializer to clean up.
|
761
|
+
// Note: The callback takes a ref in case the ref inside the state tracker
|
762
|
+
// gets removed before the callback runs via a SHUTDOWN notification.
|
763
|
+
Ref(DEBUG_LOCATION, "RemoveWatcherLocked()").release();
|
757
764
|
chand_->work_serializer_->Run(
|
758
765
|
[this]() ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) {
|
759
766
|
RemoveWatcherLocked();
|
767
|
+
Unref(DEBUG_LOCATION, "RemoveWatcherLocked()");
|
760
768
|
},
|
761
769
|
DEBUG_LOCATION);
|
762
770
|
}
|
@@ -219,7 +219,6 @@ class GrpcLb : public LoadBalancingPolicy {
|
|
219
219
|
void SendClientLoadReportLocked();
|
220
220
|
|
221
221
|
// EventEngine callbacks
|
222
|
-
void MaybeSendClientLoadReport();
|
223
222
|
void MaybeSendClientLoadReportLocked();
|
224
223
|
|
225
224
|
static void ClientLoadReportDone(void* arg, grpc_error_handle error);
|
@@ -996,15 +995,11 @@ void GrpcLb::BalancerCallState::ScheduleNextClientLoadReportLocked() {
|
|
996
995
|
GetDefaultEventEngine()->RunAfter(client_stats_report_interval_, [this] {
|
997
996
|
ApplicationCallbackExecCtx callback_exec_ctx;
|
998
997
|
ExecCtx exec_ctx;
|
999
|
-
|
998
|
+
grpclb_policy()->work_serializer()->Run(
|
999
|
+
[this] { MaybeSendClientLoadReportLocked(); }, DEBUG_LOCATION);
|
1000
1000
|
});
|
1001
1001
|
}
|
1002
1002
|
|
1003
|
-
void GrpcLb::BalancerCallState::MaybeSendClientLoadReport() {
|
1004
|
-
grpclb_policy()->work_serializer()->Run(
|
1005
|
-
[this] { MaybeSendClientLoadReportLocked(); }, DEBUG_LOCATION);
|
1006
|
-
}
|
1007
|
-
|
1008
1003
|
void GrpcLb::BalancerCallState::MaybeSendClientLoadReportLocked() {
|
1009
1004
|
client_load_report_handle_.reset();
|
1010
1005
|
if (this != grpclb_policy()->lb_calld_.get()) {
|
@@ -50,6 +50,7 @@
|
|
50
50
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
51
51
|
#include "src/core/lib/gprpp/time.h"
|
52
52
|
#include "src/core/lib/gprpp/work_serializer.h"
|
53
|
+
#include "src/core/lib/iomgr/exec_ctx.h"
|
53
54
|
#include "src/core/lib/iomgr/pollset_set.h"
|
54
55
|
#include "src/core/lib/json/json.h"
|
55
56
|
#include "src/core/lib/load_balancing/lb_policy.h"
|
@@ -456,6 +457,8 @@ WeightedTargetLb::WeightedChild::DelayedRemovalTimer::DelayedRemovalTimer(
|
|
456
457
|
: weighted_child_(std::move(weighted_child)) {
|
457
458
|
timer_handle_ = GetDefaultEventEngine()->RunAfter(
|
458
459
|
kChildRetentionInterval, [self = Ref()]() mutable {
|
460
|
+
ApplicationCallbackExecCtx app_exec_ctx;
|
461
|
+
ExecCtx exec_ctx;
|
459
462
|
self->weighted_child_->weighted_target_policy_->work_serializer()->Run(
|
460
463
|
[self = std::move(self)] { self->OnTimerLocked(); },
|
461
464
|
DEBUG_LOCATION);
|
@@ -414,15 +414,35 @@ void GoogleCloud2ProdResolver::StartXdsResolver() {
|
|
414
414
|
|
415
415
|
class GoogleCloud2ProdResolverFactory : public ResolverFactory {
|
416
416
|
public:
|
417
|
-
|
418
|
-
|
417
|
+
absl::string_view scheme() const override { return "google-c2p"; }
|
418
|
+
|
419
|
+
bool IsValidUri(const URI& uri) const override {
|
420
|
+
if (GPR_UNLIKELY(!uri.authority().empty())) {
|
421
|
+
gpr_log(GPR_ERROR, "google-c2p URI scheme does not support authorities");
|
422
|
+
return false;
|
423
|
+
}
|
424
|
+
return true;
|
425
|
+
}
|
426
|
+
|
427
|
+
OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
|
428
|
+
if (!IsValidUri(args.uri)) return nullptr;
|
429
|
+
return MakeOrphanable<GoogleCloud2ProdResolver>(std::move(args));
|
430
|
+
}
|
431
|
+
};
|
432
|
+
|
433
|
+
// TODO(apolcyn): remove this class after user code has updated to the
|
434
|
+
// stable "google-c2p" URI scheme.
|
435
|
+
class ExperimentalGoogleCloud2ProdResolverFactory : public ResolverFactory {
|
436
|
+
public:
|
419
437
|
absl::string_view scheme() const override {
|
420
438
|
return "google-c2p-experimental";
|
421
439
|
}
|
422
440
|
|
423
441
|
bool IsValidUri(const URI& uri) const override {
|
424
442
|
if (GPR_UNLIKELY(!uri.authority().empty())) {
|
425
|
-
gpr_log(
|
443
|
+
gpr_log(
|
444
|
+
GPR_ERROR,
|
445
|
+
"google-c2p-experimental URI scheme does not support authorities");
|
426
446
|
return false;
|
427
447
|
}
|
428
448
|
return true;
|
@@ -439,6 +459,8 @@ class GoogleCloud2ProdResolverFactory : public ResolverFactory {
|
|
439
459
|
void RegisterCloud2ProdResolver(CoreConfiguration::Builder* builder) {
|
440
460
|
builder->resolver_registry()->RegisterResolverFactory(
|
441
461
|
absl::make_unique<GoogleCloud2ProdResolverFactory>());
|
462
|
+
builder->resolver_registry()->RegisterResolverFactory(
|
463
|
+
absl::make_unique<ExperimentalGoogleCloud2ProdResolverFactory>());
|
442
464
|
}
|
443
465
|
|
444
466
|
} // namespace grpc_core
|
@@ -22,15 +22,17 @@
|
|
22
22
|
|
23
23
|
#include "absl/container/flat_hash_set.h"
|
24
24
|
|
25
|
+
#include "src/core/lib/gprpp/no_destruct.h"
|
25
26
|
#include "src/core/lib/gprpp/sync.h"
|
26
27
|
|
27
28
|
namespace grpc_event_engine {
|
28
29
|
namespace experimental {
|
29
30
|
|
30
31
|
namespace {
|
31
|
-
grpc_core::Mutex g_mu;
|
32
|
-
bool g_registered{false};
|
33
|
-
absl::flat_hash_set<Forkable
|
32
|
+
grpc_core::NoDestruct<grpc_core::Mutex> g_mu;
|
33
|
+
bool g_registered ABSL_GUARDED_BY(g_mu){false};
|
34
|
+
grpc_core::NoDestruct<absl::flat_hash_set<Forkable*>> g_forkables
|
35
|
+
ABSL_GUARDED_BY(g_mu);
|
34
36
|
} // namespace
|
35
37
|
|
36
38
|
Forkable::Forkable() { ManageForkable(this); }
|
@@ -38,39 +40,40 @@ Forkable::Forkable() { ManageForkable(this); }
|
|
38
40
|
Forkable::~Forkable() { StopManagingForkable(this); }
|
39
41
|
|
40
42
|
void RegisterForkHandlers() {
|
41
|
-
grpc_core::MutexLock lock(
|
42
|
-
|
43
|
-
|
43
|
+
grpc_core::MutexLock lock(g_mu.get());
|
44
|
+
if (!absl::exchange(g_registered, true)) {
|
45
|
+
pthread_atfork(PrepareFork, PostforkParent, PostforkChild);
|
46
|
+
}
|
44
47
|
};
|
45
48
|
|
46
49
|
void PrepareFork() {
|
47
|
-
grpc_core::MutexLock lock(
|
48
|
-
for (auto* forkable : g_forkables) {
|
50
|
+
grpc_core::MutexLock lock(g_mu.get());
|
51
|
+
for (auto* forkable : *g_forkables) {
|
49
52
|
forkable->PrepareFork();
|
50
53
|
}
|
51
54
|
}
|
52
55
|
void PostforkParent() {
|
53
|
-
grpc_core::MutexLock lock(
|
54
|
-
for (auto* forkable : g_forkables) {
|
56
|
+
grpc_core::MutexLock lock(g_mu.get());
|
57
|
+
for (auto* forkable : *g_forkables) {
|
55
58
|
forkable->PostforkParent();
|
56
59
|
}
|
57
60
|
}
|
58
61
|
|
59
62
|
void PostforkChild() {
|
60
|
-
grpc_core::MutexLock lock(
|
61
|
-
for (auto* forkable : g_forkables) {
|
63
|
+
grpc_core::MutexLock lock(g_mu.get());
|
64
|
+
for (auto* forkable : *g_forkables) {
|
62
65
|
forkable->PostforkChild();
|
63
66
|
}
|
64
67
|
}
|
65
68
|
|
66
69
|
void ManageForkable(Forkable* forkable) {
|
67
|
-
grpc_core::MutexLock lock(
|
68
|
-
g_forkables
|
70
|
+
grpc_core::MutexLock lock(g_mu.get());
|
71
|
+
g_forkables->insert(forkable);
|
69
72
|
}
|
70
73
|
|
71
74
|
void StopManagingForkable(Forkable* forkable) {
|
72
|
-
grpc_core::MutexLock lock(
|
73
|
-
g_forkables
|
75
|
+
grpc_core::MutexLock lock(g_mu.get());
|
76
|
+
g_forkables->erase(forkable);
|
74
77
|
}
|
75
78
|
|
76
79
|
} // namespace experimental
|
@@ -184,6 +184,8 @@ DNSResolver::TaskHandle NativeDNSResolver::LookupSRV(
|
|
184
184
|
grpc_pollset_set* /* interested_parties */,
|
185
185
|
absl::string_view /* name_server */) {
|
186
186
|
GetDefaultEventEngine()->Run([on_resolved] {
|
187
|
+
ApplicationCallbackExecCtx app_exec_ctx;
|
188
|
+
ExecCtx exec_ctx;
|
187
189
|
on_resolved(absl::UnimplementedError(
|
188
190
|
"The Native resolver does not support looking up SRV records"));
|
189
191
|
});
|
@@ -197,6 +199,8 @@ DNSResolver::TaskHandle NativeDNSResolver::LookupTXT(
|
|
197
199
|
absl::string_view /* name_server */) {
|
198
200
|
// Not supported
|
199
201
|
GetDefaultEventEngine()->Run([on_resolved] {
|
202
|
+
ApplicationCallbackExecCtx app_exec_ctx;
|
203
|
+
ExecCtx exec_ctx;
|
200
204
|
on_resolved(absl::UnimplementedError(
|
201
205
|
"The Native resolver does not support looking up TXT records"));
|
202
206
|
});
|
@@ -168,6 +168,8 @@ DNSResolver::TaskHandle NativeDNSResolver::LookupSRV(
|
|
168
168
|
grpc_pollset_set* /* interested_parties */,
|
169
169
|
absl::string_view /* name_server */) {
|
170
170
|
GetDefaultEventEngine()->Run([on_resolved] {
|
171
|
+
ApplicationCallbackExecCtx app_exec_ctx;
|
172
|
+
ExecCtx exec_ctx;
|
171
173
|
on_resolved(absl::UnimplementedError(
|
172
174
|
"The Native resolver does not support looking up SRV records"));
|
173
175
|
});
|
@@ -181,6 +183,8 @@ DNSResolver::TaskHandle NativeDNSResolver::LookupTXT(
|
|
181
183
|
absl::string_view /* name_server */) {
|
182
184
|
// Not supported
|
183
185
|
GetDefaultEventEngine()->Run([on_resolved] {
|
186
|
+
ApplicationCallbackExecCtx app_exec_ctx;
|
187
|
+
ExecCtx exec_ctx;
|
184
188
|
on_resolved(absl::UnimplementedError(
|
185
189
|
"The Native resolver does not support looking up TXT records"));
|
186
190
|
});
|
@@ -86,7 +86,6 @@ end
|
|
86
86
|
|
87
87
|
env_append 'CPPFLAGS', '-DGPR_BACKWARDS_COMPATIBILITY_MODE'
|
88
88
|
env_append 'CPPFLAGS', '-DGRPC_XDS_USER_AGENT_NAME_SUFFIX="\"RUBY\""'
|
89
|
-
env_append 'CPPFLAGS', '-DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
|
90
89
|
|
91
90
|
require_relative '../../lib/grpc/version'
|
92
91
|
env_append 'CPPFLAGS', '-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX="\"' + GRPC::VERSION + '\""'
|
@@ -111,6 +110,7 @@ unless windows
|
|
111
110
|
exit 1 unless $? == 0
|
112
111
|
end
|
113
112
|
|
113
|
+
$CFLAGS << ' -DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
|
114
114
|
$CFLAGS << ' -I' + File.join(grpc_root, 'include')
|
115
115
|
|
116
116
|
ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', 'ext-export')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.49.
|
4
|
+
version: 1.49.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gRPC Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: src/ruby/bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -2869,9 +2869,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2869
2869
|
version: 2.5.0
|
2870
2870
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2871
2871
|
requirements:
|
2872
|
-
- - "
|
2872
|
+
- - ">="
|
2873
2873
|
- !ruby/object:Gem::Version
|
2874
|
-
version:
|
2874
|
+
version: '0'
|
2875
2875
|
requirements: []
|
2876
2876
|
rubygems_version: 3.3.4
|
2877
2877
|
signing_key:
|