grpc 1.28.0.pre2 → 1.28.0

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.

@@ -21,13 +21,14 @@
21
21
 
22
22
  #include <set>
23
23
 
24
+ #include "absl/types/optional.h"
25
+
24
26
  #include "src/core/ext/filters/client_channel/service_config.h"
25
27
  #include "src/core/ext/filters/client_channel/xds/xds_api.h"
26
28
  #include "src/core/ext/filters/client_channel/xds/xds_bootstrap.h"
27
29
  #include "src/core/ext/filters/client_channel/xds/xds_client_stats.h"
28
30
  #include "src/core/lib/gprpp/map.h"
29
31
  #include "src/core/lib/gprpp/memory.h"
30
- #include "src/core/lib/gprpp/optional.h"
31
32
  #include "src/core/lib/gprpp/orphanable.h"
32
33
  #include "src/core/lib/gprpp/ref_counted.h"
33
34
  #include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -86,20 +87,26 @@ class XdsClient : public InternallyRefCounted<XdsClient> {
86
87
  // keep a raw pointer to the watcher, which may be used only for
87
88
  // cancellation. (Because the caller does not own the watcher, the
88
89
  // pointer must not be used for any other purpose.)
90
+ // If the caller is going to start a new watch after cancelling the
91
+ // old one, it should set delay_unsubscription to true.
89
92
  void WatchClusterData(StringView cluster_name,
90
93
  std::unique_ptr<ClusterWatcherInterface> watcher);
91
94
  void CancelClusterDataWatch(StringView cluster_name,
92
- ClusterWatcherInterface* watcher);
95
+ ClusterWatcherInterface* watcher,
96
+ bool delay_unsubscription = false);
93
97
 
94
98
  // Start and cancel endpoint data watch for a cluster.
95
99
  // The XdsClient takes ownership of the watcher, but the caller may
96
100
  // keep a raw pointer to the watcher, which may be used only for
97
101
  // cancellation. (Because the caller does not own the watcher, the
98
102
  // pointer must not be used for any other purpose.)
103
+ // If the caller is going to start a new watch after cancelling the
104
+ // old one, it should set delay_unsubscription to true.
99
105
  void WatchEndpointData(StringView eds_service_name,
100
106
  std::unique_ptr<EndpointWatcherInterface> watcher);
101
107
  void CancelEndpointDataWatch(StringView eds_service_name,
102
- EndpointWatcherInterface* watcher);
108
+ EndpointWatcherInterface* watcher,
109
+ bool delay_unsubscription = false);
103
110
 
104
111
  // Adds and removes drop stats for cluster_name and eds_service_name.
105
112
  RefCountedPtr<XdsClusterDropStats> AddClusterDropStats(
@@ -167,7 +174,8 @@ class XdsClient : public InternallyRefCounted<XdsClient> {
167
174
  void CancelConnectivityWatchLocked();
168
175
 
169
176
  void Subscribe(const std::string& type_url, const std::string& name);
170
- void Unsubscribe(const std::string& type_url, const std::string& name);
177
+ void Unsubscribe(const std::string& type_url, const std::string& name,
178
+ bool delay_unsubscription);
171
179
 
172
180
  private:
173
181
  class StateWatcher;
@@ -189,7 +197,7 @@ class XdsClient : public InternallyRefCounted<XdsClient> {
189
197
  std::map<ClusterWatcherInterface*, std::unique_ptr<ClusterWatcherInterface>>
190
198
  watchers;
191
199
  // The latest data seen from CDS.
192
- Optional<XdsApi::CdsUpdate> update;
200
+ absl::optional<XdsApi::CdsUpdate> update;
193
201
  };
194
202
 
195
203
  struct EndpointState {
@@ -197,12 +205,18 @@ class XdsClient : public InternallyRefCounted<XdsClient> {
197
205
  std::unique_ptr<EndpointWatcherInterface>>
198
206
  watchers;
199
207
  // The latest data seen from EDS.
200
- XdsApi::EdsUpdate update;
208
+ absl::optional<XdsApi::EdsUpdate> update;
201
209
  };
202
210
 
203
211
  struct LoadReportState {
212
+ struct LocalityState {
213
+ std::set<XdsClusterLocalityStats*> locality_stats;
214
+ std::vector<XdsClusterLocalityStats::Snapshot> deleted_locality_stats;
215
+ };
216
+
204
217
  std::set<XdsClusterDropStats*> drop_stats;
205
- std::map<RefCountedPtr<XdsLocalityName>, std::set<XdsClusterLocalityStats*>,
218
+ XdsClusterDropStats::DroppedRequestsMap deleted_drop_stats;
219
+ std::map<RefCountedPtr<XdsLocalityName>, LocalityState,
206
220
  XdsLocalityName::Less>
207
221
  locality_stats;
208
222
  grpc_millis last_report_time = ExecCtx::Get()->Now();
@@ -215,7 +229,8 @@ class XdsClient : public InternallyRefCounted<XdsClient> {
215
229
  const std::string& cluster_name,
216
230
  RefCountedPtr<ServiceConfig>* service_config) const;
217
231
 
218
- XdsApi::ClusterLoadReportMap BuildLoadReportSnapshot();
232
+ XdsApi::ClusterLoadReportMap BuildLoadReportSnapshot(
233
+ const std::set<std::string>& clusters);
219
234
 
220
235
  // Channel arg vtable functions.
221
236
  static void* ChannelArgCopy(void* p);
@@ -239,11 +254,12 @@ class XdsClient : public InternallyRefCounted<XdsClient> {
239
254
  // The channel for communicating with the xds server.
240
255
  OrphanablePtr<ChannelState> chand_;
241
256
 
242
- std::string route_config_name_;
243
- std::string cluster_name_;
244
- // All the received clusters are cached, no matter they are watched or not.
257
+ absl::optional<XdsApi::LdsUpdate> lds_result_;
258
+ absl::optional<XdsApi::RdsUpdate> rds_result_;
259
+
260
+ // One entry for each watched CDS resource.
245
261
  std::map<std::string /*cluster_name*/, ClusterState> cluster_map_;
246
- // Only the watched EDS service names are stored.
262
+ // One entry for each watched EDS resource.
247
263
  std::map<std::string /*eds_service_name*/, EndpointState> endpoint_map_;
248
264
  std::map<
249
265
  std::pair<std::string /*cluster_name*/, std::string /*eds_service_name*/>,
@@ -117,6 +117,15 @@ class CondVar {
117
117
  }
118
118
  }
119
119
 
120
+ // Returns true iff we timed-out
121
+ template <typename Predicate>
122
+ bool WaitUntil(Mutex* mu, Predicate pred, const gpr_timespec& deadline) {
123
+ while (!pred()) {
124
+ if (Wait(mu, deadline)) return true;
125
+ }
126
+ return false;
127
+ }
128
+
120
129
  private:
121
130
  gpr_cv cv_;
122
131
  };
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.28.0.pre2'
17
+ VERSION = '1.28.0'
18
18
  end
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.28.0.pre2
4
+ version: 1.28.0
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: 2020-03-03 00:00:00.000000000 Z
11
+ date: 2020-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -289,6 +289,8 @@ files:
289
289
  - src/core/ext/filters/client_channel/http_proxy.h
290
290
  - src/core/ext/filters/client_channel/lb_policy.cc
291
291
  - src/core/ext/filters/client_channel/lb_policy.h
292
+ - src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
293
+ - src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h
292
294
  - src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
293
295
  - src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h
294
296
  - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -1902,50 +1904,50 @@ required_ruby_version: !ruby/object:Gem::Requirement
1902
1904
  version: 2.3.0
1903
1905
  required_rubygems_version: !ruby/object:Gem::Requirement
1904
1906
  requirements:
1905
- - - ">"
1907
+ - - ">="
1906
1908
  - !ruby/object:Gem::Version
1907
- version: 1.3.1
1909
+ version: '0'
1908
1910
  requirements: []
1909
1911
  rubygems_version: 3.1.2
1910
1912
  signing_key:
1911
1913
  specification_version: 4
1912
1914
  summary: GRPC system in Ruby
1913
1915
  test_files:
1914
- - src/ruby/spec/call_credentials_spec.rb
1915
- - src/ruby/spec/support/services.rb
1916
- - src/ruby/spec/support/helpers.rb
1917
- - src/ruby/spec/generic/service_spec.rb
1918
- - src/ruby/spec/generic/active_call_spec.rb
1916
+ - src/ruby/spec/time_consts_spec.rb
1917
+ - src/ruby/spec/client_auth_spec.rb
1918
+ - src/ruby/spec/generic/client_stub_spec.rb
1919
1919
  - src/ruby/spec/generic/rpc_desc_spec.rb
1920
- - src/ruby/spec/generic/rpc_server_pool_spec.rb
1921
- - src/ruby/spec/generic/server_interceptors_spec.rb
1922
1920
  - src/ruby/spec/generic/client_interceptors_spec.rb
1923
1921
  - src/ruby/spec/generic/interceptor_registry_spec.rb
1922
+ - src/ruby/spec/generic/service_spec.rb
1923
+ - src/ruby/spec/generic/rpc_server_pool_spec.rb
1924
+ - src/ruby/spec/generic/active_call_spec.rb
1924
1925
  - src/ruby/spec/generic/rpc_server_spec.rb
1925
- - src/ruby/spec/generic/client_stub_spec.rb
1926
- - src/ruby/spec/server_credentials_spec.rb
1927
- - src/ruby/spec/time_consts_spec.rb
1928
- - src/ruby/spec/client_server_spec.rb
1929
- - src/ruby/spec/channel_connection_spec.rb
1926
+ - src/ruby/spec/generic/server_interceptors_spec.rb
1927
+ - src/ruby/spec/support/helpers.rb
1928
+ - src/ruby/spec/support/services.rb
1930
1929
  - src/ruby/spec/spec_helper.rb
1931
- - src/ruby/spec/testdata/README
1932
- - src/ruby/spec/testdata/ca.pem
1933
- - src/ruby/spec/testdata/client.pem
1934
- - src/ruby/spec/testdata/server1.pem
1935
- - src/ruby/spec/testdata/server1.key
1936
- - src/ruby/spec/testdata/client.key
1937
- - src/ruby/spec/call_spec.rb
1938
- - src/ruby/spec/server_spec.rb
1930
+ - src/ruby/spec/server_credentials_spec.rb
1939
1931
  - src/ruby/spec/channel_spec.rb
1940
- - src/ruby/spec/errors_spec.rb
1932
+ - src/ruby/spec/call_spec.rb
1933
+ - src/ruby/spec/channel_connection_spec.rb
1934
+ - src/ruby/spec/channel_credentials_spec.rb
1935
+ - src/ruby/spec/client_server_spec.rb
1941
1936
  - src/ruby/spec/compression_options_spec.rb
1942
- - src/ruby/spec/google_rpc_status_utils_spec.rb
1943
1937
  - src/ruby/spec/pb/duplicate/codegen_spec.rb
1944
- - src/ruby/spec/pb/health/checker_spec.rb
1945
- - src/ruby/spec/pb/codegen/package_option_spec.rb
1946
1938
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto
1947
1939
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_ruby_style.proto
1948
1940
  - src/ruby/spec/pb/codegen/grpc/testing/package_options.proto
1949
- - src/ruby/spec/channel_credentials_spec.rb
1950
- - src/ruby/spec/client_auth_spec.rb
1941
+ - src/ruby/spec/pb/codegen/package_option_spec.rb
1942
+ - src/ruby/spec/pb/health/checker_spec.rb
1943
+ - src/ruby/spec/testdata/client.key
1944
+ - src/ruby/spec/testdata/server1.pem
1945
+ - src/ruby/spec/testdata/README
1946
+ - src/ruby/spec/testdata/client.pem
1947
+ - src/ruby/spec/testdata/ca.pem
1948
+ - src/ruby/spec/testdata/server1.key
1949
+ - src/ruby/spec/errors_spec.rb
1951
1950
  - src/ruby/spec/error_sanity_spec.rb
1951
+ - src/ruby/spec/google_rpc_status_utils_spec.rb
1952
+ - src/ruby/spec/server_spec.rb
1953
+ - src/ruby/spec/call_credentials_spec.rb