grpc 1.63.0 → 1.63.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51fbf1ce5c29e406b1304c3298dad8366e20d9e5a946e7cc011b0927985be55d
4
- data.tar.gz: 6a04c6ac0bbc812b3e37f5fc474ea089eedaee5fd4e78ef7c542698c7ca02a7e
3
+ metadata.gz: 45385306b018c5a5ee8deaceb0d4b2e42eff9bf3f7de922e76f4b46bab140219
4
+ data.tar.gz: 01cd49f71a51109fc90baacc84eb2c58a06bc4ed7dac78ccbc70cece75a1bd11
5
5
  SHA512:
6
- metadata.gz: b6bcf97f0c96330266b3a3ca3d2b342c54d6427a00915921c834a4656152f38f689c33f51976f1b1b3cf140b497386a29a246b2f32fd72c07d07229fee0f4943
7
- data.tar.gz: cff6a77b56a6f97669d5c287e8cc5e5f10e45614f6bac85b1ef490db1bfbe792791371f562da270a031eaf2b5ff5c9f27c3790e794c7c0455da81891e9cf4296
6
+ metadata.gz: 3c79a81a75a8e55799f231fcfc0f918aa990d984e59ef31eec07273e4a7df7141b131fc0b433bab0095e773acde8963021a350b3bd9974e7191604f06f851145
7
+ data.tar.gz: c1b5cc5e1e4a5af78b08d5d60513b4058514990a2877292b4c7ea8b1710ecd46d8ecfdfa3c81a2ba823aabf8d2dd0b7cd19f6d5aa29f6a873023612681a3b78f
data/Makefile CHANGED
@@ -368,7 +368,7 @@ Q = @
368
368
  endif
369
369
 
370
370
  CORE_VERSION = 40.0.0
371
- CPP_VERSION = 1.63.0
371
+ CPP_VERSION = 1.63.2
372
372
 
373
373
  CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
374
374
  CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@@ -92,12 +92,14 @@ constexpr Base64InverseTable kBase64InverseTable;
92
92
  class HPackParser::Input {
93
93
  public:
94
94
  Input(grpc_slice_refcount* current_slice_refcount, const uint8_t* begin,
95
- const uint8_t* end, absl::BitGenRef bitsrc, HpackParseResult& error)
95
+ const uint8_t* end, absl::BitGenRef bitsrc,
96
+ HpackParseResult& frame_error, HpackParseResult& field_error)
96
97
  : current_slice_refcount_(current_slice_refcount),
97
98
  begin_(begin),
98
99
  end_(end),
99
100
  frontier_(begin),
100
- error_(error),
101
+ frame_error_(frame_error),
102
+ field_error_(field_error),
101
103
  bitsrc_(bitsrc) {}
102
104
 
103
105
  // If input is backed by a slice, retrieve its refcount. If not, return
@@ -216,14 +218,18 @@ class HPackParser::Input {
216
218
 
217
219
  // Check if we saw an EOF
218
220
  bool eof_error() const {
219
- return min_progress_size_ != 0 || error_.connection_error();
221
+ return min_progress_size_ != 0 || frame_error_.connection_error();
222
+ }
223
+
224
+ // Reset the field error to be ok
225
+ void ClearFieldError() {
226
+ if (field_error_.ok()) return;
227
+ field_error_ = HpackParseResult();
220
228
  }
221
229
 
222
230
  // Minimum number of bytes to unstuck the current parse
223
231
  size_t min_progress_size() const { return min_progress_size_; }
224
232
 
225
- bool has_error() const { return !error_.ok(); }
226
-
227
233
  // Set the current error - tweaks the error to include a stream id so that
228
234
  // chttp2 does not close the connection.
229
235
  // Intended for errors that are specific to a stream and recoverable.
@@ -247,10 +253,7 @@ class HPackParser::Input {
247
253
  // read prior to being able to get further in this parse.
248
254
  void UnexpectedEOF(size_t min_progress_size) {
249
255
  GPR_ASSERT(min_progress_size > 0);
250
- if (min_progress_size_ != 0 || error_.connection_error()) {
251
- GPR_DEBUG_ASSERT(eof_error());
252
- return;
253
- }
256
+ if (eof_error()) return;
254
257
  // Set min progress size, taking into account bytes parsed already but not
255
258
  // consumed.
256
259
  min_progress_size_ = min_progress_size + (begin_ - frontier_);
@@ -303,13 +306,18 @@ class HPackParser::Input {
303
306
  // Do not use this directly, instead use SetErrorAndContinueParsing or
304
307
  // SetErrorAndStopParsing.
305
308
  void SetError(HpackParseResult error) {
306
- if (!error_.ok() || min_progress_size_ > 0) {
307
- if (error.connection_error() && !error_.connection_error()) {
308
- error_ = std::move(error); // connection errors dominate
309
+ SetErrorFor(frame_error_, error);
310
+ SetErrorFor(field_error_, std::move(error));
311
+ }
312
+
313
+ void SetErrorFor(HpackParseResult& error, HpackParseResult new_error) {
314
+ if (!error.ok() || min_progress_size_ > 0) {
315
+ if (new_error.connection_error() && !error.connection_error()) {
316
+ error = std::move(new_error); // connection errors dominate
309
317
  }
310
318
  return;
311
319
  }
312
- error_ = std::move(error);
320
+ error = std::move(new_error);
313
321
  }
314
322
 
315
323
  // Refcount if we are backed by a slice
@@ -321,7 +329,8 @@ class HPackParser::Input {
321
329
  // Frontier denotes the first byte past successfully processed input
322
330
  const uint8_t* frontier_;
323
331
  // Current error
324
- HpackParseResult& error_;
332
+ HpackParseResult& frame_error_;
333
+ HpackParseResult& field_error_;
325
334
  // If the error was EOF, we flag it here by noting how many more bytes would
326
335
  // be needed to make progress
327
336
  size_t min_progress_size_ = 0;
@@ -598,6 +607,7 @@ class HPackParser::Parser {
598
607
  bool ParseTop() {
599
608
  GPR_DEBUG_ASSERT(state_.parse_state == ParseState::kTop);
600
609
  auto cur = *input_->Next();
610
+ input_->ClearFieldError();
601
611
  switch (cur >> 4) {
602
612
  // Literal header not indexed - First byte format: 0000xxxx
603
613
  // Literal header never indexed - First byte format: 0001xxxx
@@ -703,7 +713,7 @@ class HPackParser::Parser {
703
713
  break;
704
714
  }
705
715
  gpr_log(
706
- GPR_DEBUG, "HTTP:%d:%s:%s: %s%s", log_info_.stream_id, type,
716
+ GPR_INFO, "HTTP:%d:%s:%s: %s%s", log_info_.stream_id, type,
707
717
  log_info_.is_client ? "CLI" : "SVR", memento.md.DebugString().c_str(),
708
718
  memento.parse_status == nullptr
709
719
  ? ""
@@ -952,11 +962,10 @@ class HPackParser::Parser {
952
962
  state_.string_length)
953
963
  : String::Parse(input_, state_.is_string_huff_compressed,
954
964
  state_.string_length);
955
- HpackParseResult& status = state_.frame_error;
956
965
  absl::string_view key_string;
957
966
  if (auto* s = absl::get_if<Slice>(&state_.key)) {
958
967
  key_string = s->as_string_view();
959
- if (status.ok()) {
968
+ if (state_.field_error.ok()) {
960
969
  auto r = ValidateKey(key_string);
961
970
  if (r != ValidateMetadataResult::kOk) {
962
971
  input_->SetErrorAndContinueParsing(
@@ -966,7 +975,7 @@ class HPackParser::Parser {
966
975
  } else {
967
976
  const auto* memento = absl::get<const HPackTable::Memento*>(state_.key);
968
977
  key_string = memento->md.key();
969
- if (status.ok() && memento->parse_status != nullptr) {
978
+ if (state_.field_error.ok() && memento->parse_status != nullptr) {
970
979
  input_->SetErrorAndContinueParsing(*memento->parse_status);
971
980
  }
972
981
  }
@@ -993,16 +1002,16 @@ class HPackParser::Parser {
993
1002
  key_string.size() + value.wire_size + hpack_constants::kEntryOverhead;
994
1003
  auto md = grpc_metadata_batch::Parse(
995
1004
  key_string, std::move(value_slice), state_.add_to_table, transport_size,
996
- [key_string, &status, this](absl::string_view message, const Slice&) {
997
- if (!status.ok()) return;
1005
+ [key_string, this](absl::string_view message, const Slice&) {
1006
+ if (!state_.field_error.ok()) return;
998
1007
  input_->SetErrorAndContinueParsing(
999
1008
  HpackParseResult::MetadataParseError(key_string));
1000
1009
  gpr_log(GPR_ERROR, "Error parsing '%s' metadata: %s",
1001
1010
  std::string(key_string).c_str(),
1002
1011
  std::string(message).c_str());
1003
1012
  });
1004
- HPackTable::Memento memento{std::move(md),
1005
- status.PersistentStreamErrorOrNullptr()};
1013
+ HPackTable::Memento memento{
1014
+ std::move(md), state_.field_error.PersistentStreamErrorOrNullptr()};
1006
1015
  input_->UpdateFrontier();
1007
1016
  state_.parse_state = ParseState::kTop;
1008
1017
  if (state_.add_to_table) {
@@ -1115,13 +1124,13 @@ grpc_error_handle HPackParser::Parse(
1115
1124
  std::vector<uint8_t> buffer = std::move(unparsed_bytes_);
1116
1125
  return ParseInput(
1117
1126
  Input(nullptr, buffer.data(), buffer.data() + buffer.size(), bitsrc,
1118
- state_.frame_error),
1127
+ state_.frame_error, state_.field_error),
1119
1128
  is_last, call_tracer);
1120
1129
  }
1121
- return ParseInput(
1122
- Input(slice.refcount, GRPC_SLICE_START_PTR(slice),
1123
- GRPC_SLICE_END_PTR(slice), bitsrc, state_.frame_error),
1124
- is_last, call_tracer);
1130
+ return ParseInput(Input(slice.refcount, GRPC_SLICE_START_PTR(slice),
1131
+ GRPC_SLICE_END_PTR(slice), bitsrc, state_.frame_error,
1132
+ state_.field_error),
1133
+ is_last, call_tracer);
1125
1134
  }
1126
1135
 
1127
1136
  grpc_error_handle HPackParser::ParseInput(
@@ -236,6 +236,8 @@ class HPackParser {
236
236
  HPackTable hpack_table;
237
237
  // Error so far for this frame (set by class Input)
238
238
  HpackParseResult frame_error;
239
+ // Error so far for this field (set by class Input)
240
+ HpackParseResult field_error;
239
241
  // Length of frame so far.
240
242
  uint32_t frame_length = 0;
241
243
  // Length of the string being parsed
@@ -106,23 +106,25 @@ XdsClusterLocalityStats::XdsClusterLocalityStats(
106
106
  eds_service_name_(eds_service_name),
107
107
  name_(std::move(name)) {
108
108
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
109
- gpr_log(GPR_INFO,
110
- "[xds_client %p] created locality stats %p for {%s, %s, %s, %s}",
111
- xds_client_.get(), this, std::string(lrs_server_).c_str(),
112
- std::string(cluster_name_).c_str(),
113
- std::string(eds_service_name_).c_str(),
114
- name_->human_readable_string().c_str());
109
+ gpr_log(
110
+ GPR_INFO,
111
+ "[xds_client %p] created locality stats %p for {%s, %s, %s, %s}",
112
+ xds_client_.get(), this, std::string(lrs_server_).c_str(),
113
+ std::string(cluster_name_).c_str(),
114
+ std::string(eds_service_name_).c_str(),
115
+ name_ == nullptr ? "<none>" : name_->human_readable_string().c_str());
115
116
  }
116
117
  }
117
118
 
118
119
  XdsClusterLocalityStats::~XdsClusterLocalityStats() {
119
120
  if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
120
- gpr_log(GPR_INFO,
121
- "[xds_client %p] destroying locality stats %p for {%s, %s, %s, %s}",
122
- xds_client_.get(), this, std::string(lrs_server_).c_str(),
123
- std::string(cluster_name_).c_str(),
124
- std::string(eds_service_name_).c_str(),
125
- name_->human_readable_string().c_str());
121
+ gpr_log(
122
+ GPR_INFO,
123
+ "[xds_client %p] destroying locality stats %p for {%s, %s, %s, %s}",
124
+ xds_client_.get(), this, std::string(lrs_server_).c_str(),
125
+ std::string(cluster_name_).c_str(),
126
+ std::string(eds_service_name_).c_str(),
127
+ name_ == nullptr ? "<none>" : name_->human_readable_string().c_str());
126
128
  }
127
129
  xds_client_->RemoveClusterLocalityStats(lrs_server_, cluster_name_,
128
130
  eds_service_name_, name_, this);
@@ -71,7 +71,13 @@ class PromiseLike<void>;
71
71
 
72
72
  template <typename F>
73
73
  class PromiseLike<F, absl::enable_if_t<!std::is_void<
74
- typename std::result_of<F()>::type>::value>> {
74
+ #if (defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703L) || \
75
+ (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
76
+ std::invoke_result_t<F>
77
+ #else
78
+ typename std::result_of<F()>::type
79
+ #endif
80
+ >::value>> {
75
81
  private:
76
82
  GPR_NO_UNIQUE_ADDRESS F f_;
77
83
 
@@ -93,13 +93,13 @@ absl::StatusOr<OrphanablePtr<Channel>> LegacyChannel::Create(
93
93
  *(*r)->stats_plugin_group =
94
94
  GlobalStatsPluginRegistry::GetStatsPluginsForServer(args);
95
95
  } else {
96
- experimental::StatsPluginChannelScope scope(
97
- target, args.GetOwnedString(GRPC_ARG_DEFAULT_AUTHORITY)
98
- .value_or(CoreConfiguration::Get()
99
- .resolver_registry()
100
- .GetDefaultAuthority(target)));
96
+ std::string authority = args.GetOwnedString(GRPC_ARG_DEFAULT_AUTHORITY)
97
+ .value_or(CoreConfiguration::Get()
98
+ .resolver_registry()
99
+ .GetDefaultAuthority(target));
101
100
  *(*r)->stats_plugin_group =
102
- GlobalStatsPluginRegistry::GetStatsPluginsForChannel(scope);
101
+ GlobalStatsPluginRegistry::GetStatsPluginsForChannel(
102
+ experimental::StatsPluginChannelScope(target, authority));
103
103
  }
104
104
  return MakeOrphanable<LegacyChannel>(
105
105
  grpc_channel_stack_type_is_client(builder.channel_stack_type()),
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.63.0'
17
+ VERSION = '1.63.2'
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.63.0
4
+ version: 1.63.2
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: 2024-04-26 00:00:00.000000000 Z
11
+ date: 2024-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -3570,7 +3570,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3570
3570
  - !ruby/object:Gem::Version
3571
3571
  version: '0'
3572
3572
  requirements: []
3573
- rubygems_version: 3.5.9
3573
+ rubygems_version: 3.5.17
3574
3574
  signing_key:
3575
3575
  specification_version: 4
3576
3576
  summary: GRPC system in Ruby