grpc 1.65.1 → 1.65.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +1 -1
  3. data/src/core/client_channel/subchannel.cc +10 -7
  4. data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +3 -1
  5. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +6 -6
  6. data/src/core/handshaker/http_connect/http_proxy_mapper.cc +7 -10
  7. data/src/core/lib/compression/message_compress.cc +3 -3
  8. data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +3 -3
  9. data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +1 -1
  10. data/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +6 -6
  11. data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +7 -4
  12. data/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +3 -1
  13. data/src/core/lib/event_engine/windows/win_socket.cc +4 -2
  14. data/src/core/lib/event_engine/windows/windows_endpoint.cc +5 -4
  15. data/src/core/lib/experiments/config.cc +11 -9
  16. data/src/core/lib/iomgr/endpoint_pair_windows.cc +4 -4
  17. data/src/core/lib/iomgr/socket_windows.cc +3 -3
  18. data/src/core/lib/iomgr/tcp_posix.cc +2 -1
  19. data/src/core/lib/iomgr/tcp_server_posix.cc +9 -12
  20. data/src/core/lib/iomgr/tcp_server_windows.cc +2 -2
  21. data/src/core/lib/promise/party.cc +4 -4
  22. data/src/core/load_balancing/grpclb/grpclb.cc +14 -15
  23. data/src/core/util/log.cc +2 -2
  24. data/src/ruby/lib/grpc/version.rb +1 -1
  25. data/third_party/boringssl-with-bazel/src/crypto/bytestring/cbs.c +3 -5
  26. data/third_party/boringssl-with-bazel/src/crypto/cipher_extra/e_chacha20poly1305.c +7 -0
  27. data/third_party/boringssl-with-bazel/src/crypto/cpu_arm_linux.c +4 -1
  28. data/third_party/boringssl-with-bazel/src/crypto/cpu_intel.c +0 -15
  29. data/third_party/boringssl-with-bazel/src/crypto/crypto.c +7 -61
  30. data/third_party/boringssl-with-bazel/src/crypto/dilithium/dilithium.c +43 -1
  31. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/aes.c +21 -0
  32. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/aes/internal.h +31 -7
  33. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c +0 -2
  34. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/ec/p256-nistz.c +5 -0
  35. data/third_party/boringssl-with-bazel/src/crypto/fipsmodule/self_check/fips.c +6 -4
  36. data/third_party/boringssl-with-bazel/src/crypto/internal.h +22 -10
  37. data/third_party/boringssl-with-bazel/src/crypto/kyber/kyber.c +1 -0
  38. data/third_party/boringssl-with-bazel/src/include/openssl/crypto.h +6 -11
  39. data/third_party/boringssl-with-bazel/src/include/openssl/experimental/dilithium.h +6 -0
  40. data/third_party/boringssl-with-bazel/src/include/openssl/experimental/kyber.h +10 -0
  41. data/third_party/boringssl-with-bazel/src/include/openssl/span.h +26 -12
  42. data/third_party/boringssl-with-bazel/src/include/openssl/ssl.h +83 -33
  43. data/third_party/boringssl-with-bazel/src/ssl/d1_both.cc +6 -8
  44. data/third_party/boringssl-with-bazel/src/ssl/d1_pkt.cc +4 -4
  45. data/third_party/boringssl-with-bazel/src/ssl/dtls_record.cc +14 -13
  46. data/third_party/boringssl-with-bazel/src/ssl/extensions.cc +22 -16
  47. data/third_party/boringssl-with-bazel/src/ssl/handshake_client.cc +2 -1
  48. data/third_party/boringssl-with-bazel/src/ssl/handshake_server.cc +2 -1
  49. data/third_party/boringssl-with-bazel/src/ssl/internal.h +15 -15
  50. data/third_party/boringssl-with-bazel/src/ssl/ssl_key_share.cc +1 -0
  51. data/third_party/boringssl-with-bazel/src/ssl/ssl_lib.cc +38 -27
  52. data/third_party/boringssl-with-bazel/src/ssl/ssl_privkey.cc +59 -20
  53. data/third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc +1 -1
  54. data/third_party/boringssl-with-bazel/src/ssl/tls13_both.cc +2 -1
  55. data/third_party/boringssl-with-bazel/src/ssl/tls_record.cc +1 -1
  56. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d88e35610af868428e19e63fc9fb6018ee4fc56996eb09a3c6631fb811be880f
4
- data.tar.gz: 7d92092c09d6eb7eefc895f1fcdae769a6b24f045c1d8d9c2800f468ae18af4f
3
+ metadata.gz: 0f7fb00b001baa72da1610e37b806197d5be662256faa1fe7b48a6f7f5c27017
4
+ data.tar.gz: b36119a3b270a2a66827949490d9e708ac3df7abbbb55dc74e55ea6bc3157f58
5
5
  SHA512:
6
- metadata.gz: f66411122b76358dde1eae1d1ae9e54a5e1a01263b6dce493aa025bd40bcc9a247fff47396856ecb6dc07a7bda36e53d77b0d5d040191e3ff6ba05603a59f9e0
7
- data.tar.gz: 2ff59d840774abd6adba54950d5d75f4d3208e27fb70dcf493c24ee92f932371cab38e15b5d8de3ceb2afc3ceca7da6f40e9422b96f0466d5291d55990a3e912
6
+ metadata.gz: 55ff653a9ed98a3d3122ca80187d6a8897e40b998bd0ad6e68007244939a789fb9f11733784018456e312120c75926530936bc897980aa9dde6485fa1da37ed4
7
+ data.tar.gz: a20230c8357f4909d26c4f92818d4caa276660b8ee6d668b41c58fe835da6fca97ba75f9a1c98e569c62f699c8acbcddf4c50382a38695b5dbc69188ad07dbcd
data/Makefile CHANGED
@@ -368,7 +368,7 @@ Q = @
368
368
  endif
369
369
 
370
370
  CORE_VERSION = 42.0.0
371
- CPP_VERSION = 1.65.1
371
+ CPP_VERSION = 1.65.2
372
372
 
373
373
  CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
374
374
  CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@@ -758,8 +758,10 @@ void Subchannel::OnRetryTimer() {
758
758
 
759
759
  void Subchannel::OnRetryTimerLocked() {
760
760
  if (shutdown_) return;
761
- gpr_log(GPR_INFO, "subchannel %p %s: backoff delay elapsed, reporting IDLE",
762
- this, key_.ToString().c_str());
761
+ if (GRPC_TRACE_FLAG_ENABLED(subchannel)) {
762
+ LOG(INFO) << "subchannel " << this << " " << key_.ToString()
763
+ << ": backoff delay elapsed, reporting IDLE";
764
+ }
763
765
  SetConnectivityStateLocked(GRPC_CHANNEL_IDLE, absl::OkStatus());
764
766
  }
765
767
 
@@ -803,11 +805,12 @@ void Subchannel::OnConnectingFinishedLocked(grpc_error_handle error) {
803
805
  if (connecting_result_.transport == nullptr || !PublishTransportLocked()) {
804
806
  const Duration time_until_next_attempt =
805
807
  next_attempt_time_ - Timestamp::Now();
806
- gpr_log(GPR_INFO,
807
- "subchannel %p %s: connect failed (%s), backing off for %" PRId64
808
- " ms",
809
- this, key_.ToString().c_str(), StatusToString(error).c_str(),
810
- time_until_next_attempt.millis());
808
+ if (GRPC_TRACE_FLAG_ENABLED(subchannel)) {
809
+ LOG(INFO) << "subchannel " << this << " " << key_.ToString()
810
+ << ": connect failed (" << StatusToString(error)
811
+ << "), backing off for " << time_until_next_attempt.millis()
812
+ << " ms";
813
+ }
811
814
  SetConnectivityStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
812
815
  grpc_error_to_absl_status(error));
813
816
  retry_timer_handle_ = event_engine_->RunAfter(
@@ -168,10 +168,12 @@ void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error_handle error) {
168
168
  &self->on_receive_settings_, self->args_.interested_parties, nullptr);
169
169
  self->timer_handle_ = self->event_engine_->RunAfter(
170
170
  self->args_.deadline - Timestamp::Now(),
171
- [self = self->RefAsSubclass<Chttp2Connector>()] {
171
+ [self = self->RefAsSubclass<Chttp2Connector>()]() mutable {
172
172
  ApplicationCallbackExecCtx callback_exec_ctx;
173
173
  ExecCtx exec_ctx;
174
174
  self->OnTimeout();
175
+ // Ensure the Chttp2Connector is deleted under an ExecCtx.
176
+ self.reset();
175
177
  });
176
178
  } else {
177
179
  // If the handshaking succeeded but there is no endpoint, then the
@@ -1735,8 +1735,8 @@ void grpc_chttp2_keepalive_timeout(
1735
1735
  grpc_core::RefCountedPtr<grpc_chttp2_transport> t) {
1736
1736
  t->combiner->Run(
1737
1737
  grpc_core::NewClosure([t](grpc_error_handle) {
1738
- gpr_log(GPR_INFO, "%s: Keepalive timeout. Closing transport.",
1739
- std::string(t->peer_string.as_string_view()).c_str());
1738
+ GRPC_TRACE_LOG(http, INFO) << t->peer_string.as_string_view()
1739
+ << ": Keepalive timeout. Closing transport.";
1740
1740
  send_goaway(
1741
1741
  t.get(),
1742
1742
  grpc_error_set_int(GRPC_ERROR_CREATE("keepalive_timeout"),
@@ -1756,8 +1756,8 @@ void grpc_chttp2_ping_timeout(
1756
1756
  grpc_core::RefCountedPtr<grpc_chttp2_transport> t) {
1757
1757
  t->combiner->Run(
1758
1758
  grpc_core::NewClosure([t](grpc_error_handle) {
1759
- gpr_log(GPR_INFO, "%s: Ping timeout. Closing transport.",
1760
- std::string(t->peer_string.as_string_view()).c_str());
1759
+ GRPC_TRACE_LOG(http, INFO) << t->peer_string.as_string_view()
1760
+ << ": Ping timeout. Closing transport.";
1761
1761
  send_goaway(
1762
1762
  t.get(),
1763
1763
  grpc_error_set_int(GRPC_ERROR_CREATE("ping_timeout"),
@@ -1777,8 +1777,8 @@ void grpc_chttp2_settings_timeout(
1777
1777
  grpc_core::RefCountedPtr<grpc_chttp2_transport> t) {
1778
1778
  t->combiner->Run(
1779
1779
  grpc_core::NewClosure([t](grpc_error_handle) {
1780
- gpr_log(GPR_INFO, "%s: Settings timeout. Closing transport.",
1781
- std::string(t->peer_string.as_string_view()).c_str());
1780
+ GRPC_TRACE_LOG(http, INFO) << t->peer_string.as_string_view()
1781
+ << ": Settings timeout. Closing transport.";
1782
1782
  send_goaway(
1783
1783
  t.get(),
1784
1784
  grpc_error_set_int(GRPC_ERROR_CREATE("settings_timeout"),
@@ -220,13 +220,11 @@ absl::optional<std::string> HttpProxyMapper::MapName(
220
220
  return absl::nullopt;
221
221
  }
222
222
  if (uri->scheme() == "unix") {
223
- gpr_log(GPR_INFO, "not using proxy for Unix domain socket '%s'",
224
- std::string(server_uri).c_str());
223
+ VLOG(2) << "not using proxy for Unix domain socket '" << server_uri << "'";
225
224
  return absl::nullopt;
226
225
  }
227
226
  if (uri->scheme() == "vsock") {
228
- gpr_log(GPR_INFO, "not using proxy for VSock '%s'",
229
- std::string(server_uri).c_str());
227
+ VLOG(2) << "not using proxy for VSock '" << server_uri << "'";
230
228
  return absl::nullopt;
231
229
  }
232
230
  // Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set.
@@ -239,18 +237,17 @@ absl::optional<std::string> HttpProxyMapper::MapName(
239
237
  std::string server_port;
240
238
  if (!SplitHostPort(absl::StripPrefix(uri->path(), "/"), &server_host,
241
239
  &server_port)) {
242
- gpr_log(GPR_INFO,
243
- "unable to split host and port, not checking no_proxy list for "
244
- "host '%s'",
245
- std::string(server_uri).c_str());
240
+ VLOG(2) << "unable to split host and port, not checking no_proxy list "
241
+ "for host '"
242
+ << server_uri << "'";
246
243
  } else {
247
244
  auto address = StringToSockaddr(server_host, 0);
248
245
  if (AddressIncluded(address.ok()
249
246
  ? absl::optional<grpc_resolved_address>(*address)
250
247
  : absl::nullopt,
251
248
  server_host, *no_proxy_str)) {
252
- gpr_log(GPR_INFO, "not using proxy for host in no_proxy list '%s'",
253
- std::string(server_uri).c_str());
249
+ VLOG(2) << "not using proxy for host in no_proxy list '" << server_uri
250
+ << "'";
254
251
  return absl::nullopt;
255
252
  }
256
253
  }
@@ -62,17 +62,17 @@ static int zlib_body(z_stream* zs, grpc_slice_buffer* input,
62
62
  }
63
63
  r = flate(zs, flush);
64
64
  if (r < 0 && r != Z_BUF_ERROR /* not fatal */) {
65
- LOG(INFO) << "zlib error (" << r << ")";
65
+ VLOG(2) << "zlib error (" << r << ")";
66
66
  goto error;
67
67
  }
68
68
  } while (zs->avail_out == 0);
69
69
  if (zs->avail_in) {
70
- LOG(INFO) << "zlib: not all input consumed";
70
+ VLOG(2) << "zlib: not all input consumed";
71
71
  goto error;
72
72
  }
73
73
  }
74
74
  if (r != Z_STREAM_END) {
75
- LOG(INFO) << "zlib: Data error";
75
+ VLOG(2) << "zlib: Data error";
76
76
  goto error;
77
77
  }
78
78
 
@@ -1295,9 +1295,9 @@ PosixEndpointImpl::PosixEndpointImpl(EventHandle* handle,
1295
1295
  }
1296
1296
 
1297
1297
  if (zerocopy_enabled) {
1298
- LOG(INFO) << "Tx-zero copy enabled for gRPC sends. RLIMIT_MEMLOCK value "
1299
- << "=" << GetRLimitMemLockMax()
1300
- << ",ulimit hard memlock value = " << GetUlimitHardMemLock();
1298
+ VLOG(2) << "Tx-zero copy enabled for gRPC sends. RLIMIT_MEMLOCK value "
1299
+ << "=" << GetRLimitMemLockMax()
1300
+ << ",ulimit hard memlock value = " << GetUlimitHardMemLock();
1301
1301
  }
1302
1302
  }
1303
1303
  #endif // GRPC_LINUX_ERRQUEUE
@@ -184,7 +184,7 @@ class TcpZerocopySendCtx {
184
184
  if (send_records_ == nullptr || free_send_records_ == nullptr) {
185
185
  gpr_free(send_records_);
186
186
  gpr_free(free_send_records_);
187
- LOG(INFO) << "Disabling TCP TX zerocopy due to memory pressure.\n";
187
+ VLOG(2) << "Disabling TCP TX zerocopy due to memory pressure.\n";
188
188
  memory_limited_ = true;
189
189
  enabled_ = false;
190
190
  } else {
@@ -345,14 +345,14 @@ absl::StatusOr<int> ListenerContainerAddWildcardAddresses(
345
345
  }
346
346
  if (assigned_port > 0) {
347
347
  if (!v6_sock.ok()) {
348
- LOG(INFO) << "Failed to add :: listener, the environment may not support "
349
- "IPv6: "
350
- << v6_sock.status();
348
+ VLOG(2) << "Failed to add :: listener, the environment may not support "
349
+ "IPv6: "
350
+ << v6_sock.status();
351
351
  }
352
352
  if (!v4_sock.ok()) {
353
- LOG(INFO) << "Failed to add 0.0.0.0 listener, "
354
- "the environment may not support IPv4: "
355
- << v4_sock.status();
353
+ VLOG(2) << "Failed to add 0.0.0.0 listener, "
354
+ "the environment may not support IPv4: "
355
+ << v4_sock.status();
356
356
  }
357
357
  return assigned_port;
358
358
  } else {
@@ -629,8 +629,9 @@ void PosixSocketWrapper::TrySetSocketTcpUserTimeout(
629
629
  if (0 != getsockopt(fd_, IPPROTO_TCP, TCP_USER_TIMEOUT, &newval, &len)) {
630
630
  // This log is intentionally not protected behind a flag, so that users
631
631
  // know that TCP_USER_TIMEOUT is not being used.
632
- LOG(INFO) << "TCP_USER_TIMEOUT is not available. TCP_USER_TIMEOUT "
633
- "won't be used thereafter";
632
+ GRPC_TRACE_LOG(tcp, INFO)
633
+ << "TCP_USER_TIMEOUT is not available. TCP_USER_TIMEOUT "
634
+ "won't be used thereafter";
634
635
  g_socket_supports_tcp_user_timeout.store(-1);
635
636
  } else {
636
637
  GRPC_TRACE_LOG(tcp, INFO)
@@ -684,7 +685,8 @@ bool PosixSocketWrapper::IsIpv6LoopbackAvailable() {
684
685
  int fd = socket(AF_INET6, SOCK_STREAM, 0);
685
686
  bool loopback_available = false;
686
687
  if (fd < 0) {
687
- LOG(INFO) << "Disabling AF_INET6 sockets because socket() failed.";
688
+ GRPC_TRACE_LOG(tcp, INFO)
689
+ << "Disabling AF_INET6 sockets because socket() failed.";
688
690
  } else {
689
691
  sockaddr_in6 addr;
690
692
  memset(&addr, 0, sizeof(addr));
@@ -693,7 +695,8 @@ bool PosixSocketWrapper::IsIpv6LoopbackAvailable() {
693
695
  if (bind(fd, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) == 0) {
694
696
  loopback_available = true;
695
697
  } else {
696
- LOG(INFO) << "Disabling AF_INET6 sockets because ::1 is not available.";
698
+ GRPC_TRACE_LOG(tcp, INFO)
699
+ << "Disabling AF_INET6 sockets because ::1 is not available.";
697
700
  }
698
701
  close(fd);
699
702
  }
@@ -36,6 +36,7 @@
36
36
  #include <grpc/support/thd_id.h>
37
37
 
38
38
  #include "src/core/lib/backoff/backoff.h"
39
+ #include "src/core/lib/debug/trace_impl.h"
39
40
  #include "src/core/lib/event_engine/common_closures.h"
40
41
  #include "src/core/lib/event_engine/thread_local.h"
41
42
  #include "src/core/lib/event_engine/trace.h"
@@ -317,7 +318,8 @@ bool WorkStealingThreadPool::WorkStealingThreadPoolImpl::IsQuiesced() {
317
318
  }
318
319
 
319
320
  void WorkStealingThreadPool::WorkStealingThreadPoolImpl::PrepareFork() {
320
- LOG(INFO) << "WorkStealingThreadPoolImpl::PrepareFork";
321
+ LOG_IF(INFO, GRPC_TRACE_FLAG_ENABLED(event_engine))
322
+ << "WorkStealingThreadPoolImpl::PrepareFork";
321
323
  SetForking(true);
322
324
  work_signal_.SignalAll();
323
325
  auto threads_were_shut_down = living_thread_count_.BlockUntilThreadCount(
@@ -71,7 +71,8 @@ void WinSocket::Shutdown() {
71
71
  &ioctl_num_bytes, NULL, NULL);
72
72
  if (status != 0) {
73
73
  char* utf8_message = gpr_format_message(WSAGetLastError());
74
- LOG(INFO) << "Unable to retrieve DisconnectEx pointer : " << utf8_message;
74
+ GRPC_TRACE_LOG(event_engine_endpoint, INFO)
75
+ << "Unable to retrieve DisconnectEx pointer : " << utf8_message;
75
76
  gpr_free(utf8_message);
76
77
  } else if (DisconnectEx(socket_, NULL, 0, 0) == FALSE) {
77
78
  auto last_error = WSAGetLastError();
@@ -79,7 +80,8 @@ void WinSocket::Shutdown() {
79
80
  // error, and log all others.
80
81
  if (last_error != WSAENOTCONN) {
81
82
  char* utf8_message = gpr_format_message(last_error);
82
- LOG(INFO) << "DisconnectEx failed: " << utf8_message;
83
+ GRPC_TRACE_LOG(event_engine_endpoint, INFO)
84
+ << "DisconnectEx failed: " << utf8_message;
83
85
  gpr_free(utf8_message);
84
86
  }
85
87
  }
@@ -42,8 +42,8 @@ constexpr int kMaxWSABUFCount = 16;
42
42
  void DumpSliceBuffer(SliceBuffer* buffer, absl::string_view context_string) {
43
43
  for (size_t i = 0; i < buffer->Count(); i++) {
44
44
  auto str = buffer->MutableSliceAt(i).as_string_view();
45
- gpr_log(GPR_INFO, "%s: %.*s", context_string.data(), str.length(),
46
- str.data());
45
+ GRPC_TRACE_LOG(event_engine_endpoint, INFO)
46
+ << context_string << ": " << str;
47
47
  }
48
48
  }
49
49
 
@@ -159,8 +159,9 @@ bool WindowsEndpoint::Write(absl::AnyInvocable<void(absl::Status)> on_writable,
159
159
  if (GRPC_TRACE_FLAG_ENABLED(event_engine_endpoint_data)) {
160
160
  for (size_t i = 0; i < data->Count(); i++) {
161
161
  auto str = data->RefSlice(i).as_string_view();
162
- gpr_log(GPR_INFO, "WindowsEndpoint::%p WRITE (peer=%s): %.*s", this,
163
- peer_address_string_.c_str(), str.length(), str.data());
162
+ GRPC_TRACE_LOG(event_engine_endpoint, INFO)
163
+ << "WindowsEndpoint::" << this
164
+ << " WRITE (peer=" << peer_address_string_ << "): " << str;
164
165
  }
165
166
  }
166
167
  CHECK(data->Count() <= UINT_MAX);
@@ -24,6 +24,7 @@
24
24
 
25
25
  #include "absl/functional/any_invocable.h"
26
26
  #include "absl/log/check.h"
27
+ #include "absl/log/log.h"
27
28
  #include "absl/strings/str_join.h"
28
29
  #include "absl/strings/str_split.h"
29
30
  #include "absl/strings/string_view.h"
@@ -227,19 +228,20 @@ void PrintExperimentsList() {
227
228
  }
228
229
  if (experiment_status.empty()) {
229
230
  if (!defaulted_on_experiments.empty()) {
230
- gpr_log(GPR_INFO, "gRPC experiments enabled: %s",
231
- absl::StrJoin(defaulted_on_experiments, ", ").c_str());
231
+ VLOG(2) << "gRPC experiments enabled: "
232
+ << absl::StrJoin(defaulted_on_experiments, ", ");
232
233
  }
233
234
  } else {
234
235
  if (defaulted_on_experiments.empty()) {
235
- gpr_log(GPR_INFO, "gRPC experiments: %s",
236
- absl::StrJoin(experiment_status, ", ", absl::PairFormatter(":"))
237
- .c_str());
236
+ VLOG(2) << "gRPC experiments: "
237
+ << absl::StrJoin(experiment_status, ", ",
238
+ absl::PairFormatter(":"));
238
239
  } else {
239
- gpr_log(GPR_INFO, "gRPC experiments: %s; default-enabled: %s",
240
- absl::StrJoin(experiment_status, ", ", absl::PairFormatter(":"))
241
- .c_str(),
242
- absl::StrJoin(defaulted_on_experiments, ", ").c_str());
240
+ VLOG(2) << "gRPC experiments: "
241
+ << absl::StrJoin(experiment_status, ", ",
242
+ absl::PairFormatter(":"))
243
+ << "; default-enabled: "
244
+ << absl::StrJoin(defaulted_on_experiments, ", ");
243
245
  }
244
246
  }
245
247
  }
@@ -66,13 +66,13 @@ static void create_sockets(SOCKET sv[2]) {
66
66
  closesocket(lst_sock);
67
67
  grpc_error_handle error = grpc_tcp_prepare_socket(cli_sock);
68
68
  if (!error.ok()) {
69
- LOG(INFO) << "Prepare cli_sock failed with error: "
70
- << grpc_core::StatusToString(error);
69
+ VLOG(2) << "Prepare cli_sock failed with error: "
70
+ << grpc_core::StatusToString(error);
71
71
  }
72
72
  error = grpc_tcp_prepare_socket(svr_sock);
73
73
  if (!error.ok()) {
74
- LOG(INFO) << "Prepare svr_sock failed with error: "
75
- << grpc_core::StatusToString(error);
74
+ VLOG(2) << "Prepare svr_sock failed with error: "
75
+ << grpc_core::StatusToString(error);
76
76
  }
77
77
 
78
78
  sv[1] = cli_sock;
@@ -132,7 +132,7 @@ void grpc_winsocket_shutdown(grpc_winsocket* winsocket) {
132
132
  DisconnectEx(winsocket->socket, NULL, 0, 0);
133
133
  } else {
134
134
  char* utf8_message = gpr_format_message(WSAGetLastError());
135
- LOG(INFO) << "Unable to retrieve DisconnectEx pointer : " << utf8_message;
135
+ VLOG(2) << "Unable to retrieve DisconnectEx pointer : " << utf8_message;
136
136
  gpr_free(utf8_message);
137
137
  }
138
138
  // Calling closesocket triggers invocation of any pending I/O operations with
@@ -216,7 +216,7 @@ static void probe_ipv6_once(void) {
216
216
  SOCKET s = socket(AF_INET6, SOCK_STREAM, 0);
217
217
  g_ipv6_loopback_available = 0;
218
218
  if (s == INVALID_SOCKET) {
219
- LOG(INFO) << "Disabling AF_INET6 sockets because socket() failed.";
219
+ VLOG(2) << "Disabling AF_INET6 sockets because socket() failed.";
220
220
  } else {
221
221
  grpc_sockaddr_in6 addr;
222
222
  memset(&addr, 0, sizeof(addr));
@@ -225,7 +225,7 @@ static void probe_ipv6_once(void) {
225
225
  if (bind(s, reinterpret_cast<grpc_sockaddr*>(&addr), sizeof(addr)) == 0) {
226
226
  g_ipv6_loopback_available = 1;
227
227
  } else {
228
- LOG(INFO) << "Disabling AF_INET6 sockets because ::1 is not available.";
228
+ VLOG(2) << "Disabling AF_INET6 sockets because ::1 is not available.";
229
229
  }
230
230
  closesocket(s);
231
231
  }
@@ -210,7 +210,8 @@ class TcpZerocopySendCtx {
210
210
  if (send_records_ == nullptr || free_send_records_ == nullptr) {
211
211
  gpr_free(send_records_);
212
212
  gpr_free(free_send_records_);
213
- LOG(INFO) << "Disabling TCP TX zerocopy due to memory pressure.\n";
213
+ GRPC_TRACE_LOG(tcp, INFO)
214
+ << "Disabling TCP TX zerocopy due to memory pressure.\n";
214
215
  memory_limited_ = true;
215
216
  } else {
216
217
  for (int idx = 0; idx < max_sends_; ++idx) {
@@ -424,10 +424,9 @@ static void on_read(void* arg, grpc_error_handle err) {
424
424
  int64_t dropped_connections_count =
425
425
  num_dropped_connections.fetch_add(1, std::memory_order_relaxed) + 1;
426
426
  if (dropped_connections_count % 1000 == 1) {
427
- gpr_log(GPR_INFO,
428
- "Dropped >= %" PRId64
429
- " new connection attempts due to high memory pressure",
430
- dropped_connections_count);
427
+ GRPC_TRACE_LOG(tcp, INFO)
428
+ << "Dropped >= " << dropped_connections_count
429
+ << " new connection attempts due to high memory pressure";
431
430
  }
432
431
  close(fd);
433
432
  continue;
@@ -549,16 +548,14 @@ static grpc_error_handle add_wildcard_addrs_to_server(grpc_tcp_server* s,
549
548
  }
550
549
  if (*out_port > 0) {
551
550
  if (!v6_err.ok()) {
552
- gpr_log(GPR_INFO,
553
- "Failed to add :: listener, "
554
- "the environment may not support IPv6: %s",
555
- grpc_core::StatusToString(v6_err).c_str());
551
+ GRPC_TRACE_LOG(tcp, INFO) << "Failed to add :: listener, "
552
+ << "the environment may not support IPv6: "
553
+ << grpc_core::StatusToString(v6_err);
556
554
  }
557
555
  if (!v4_err.ok()) {
558
- gpr_log(GPR_INFO,
559
- "Failed to add 0.0.0.0 listener, "
560
- "the environment may not support IPv4: %s",
561
- grpc_core::StatusToString(v4_err).c_str());
556
+ GRPC_TRACE_LOG(tcp, INFO) << "Failed to add 0.0.0.0 listener, "
557
+ << "the environment may not support IPv4: "
558
+ << grpc_core::StatusToString(v4_err);
562
559
  }
563
560
  return absl::OkStatus();
564
561
  } else {
@@ -386,8 +386,8 @@ static void on_accept(void* arg, grpc_error_handle error) {
386
386
  // this is necessary in the read/write case, it's useless for the accept
387
387
  // case. We only need to adjust the pending callback count
388
388
  if (!error.ok()) {
389
- LOG(INFO) << "Skipping on_accept due to error: "
390
- << grpc_core::StatusToString(error);
389
+ VLOG(2) << "Skipping on_accept due to error: "
390
+ << grpc_core::StatusToString(error);
391
391
 
392
392
  gpr_mu_unlock(&sp->server->mu);
393
393
  return;
@@ -288,13 +288,13 @@ bool Party::RunOneParticipant(int i) {
288
288
  currently_polling_ = kNotPolling;
289
289
  if (done) {
290
290
  if (!name.empty()) {
291
- gpr_log(GPR_INFO, "%s[%s] end poll and finish job %d", DebugTag().c_str(),
292
- std::string(name).c_str(), i);
291
+ GRPC_TRACE_LOG(promise_primitives, INFO)
292
+ << DebugTag() << "[" << name << "] end poll and finish job " << i;
293
293
  }
294
294
  participants_[i].store(nullptr, std::memory_order_relaxed);
295
295
  } else if (!name.empty()) {
296
- gpr_log(GPR_INFO, "%s[%s] end poll", DebugTag().c_str(),
297
- std::string(name).c_str());
296
+ GRPC_TRACE_LOG(promise_primitives, INFO)
297
+ << DebugTag() << "[" << name << "] end poll";
298
298
  }
299
299
  return done;
300
300
  }
@@ -489,10 +489,10 @@ class GrpcLb final : public LoadBalancingPolicy {
489
489
  new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
490
490
  // In TRANSIENT_FAILURE. Cancel the fallback timer and go into
491
491
  // fallback mode immediately.
492
- gpr_log(GPR_INFO,
493
- "[grpclb %p] balancer channel in state:TRANSIENT_FAILURE (%s); "
494
- "entering fallback mode",
495
- parent_.get(), status.ToString().c_str());
492
+ GRPC_TRACE_LOG(glb, INFO)
493
+ << "[grpclb " << parent_.get()
494
+ << "] balancer channel in state:TRANSIENT_FAILURE ("
495
+ << status.ToString() << "); entering fallback mode";
496
496
  parent_->fallback_at_startup_checks_pending_ = false;
497
497
  parent_->channel_control_helper()->GetEventEngine()->Cancel(
498
498
  *parent_->lb_fallback_timer_handle_);
@@ -670,11 +670,10 @@ class GrpcLb::Serverlist::AddressIterator final
670
670
  std::string lb_token(server.load_balance_token, lb_token_length);
671
671
  if (lb_token.empty()) {
672
672
  auto addr_uri = grpc_sockaddr_to_uri(&addr);
673
- gpr_log(GPR_INFO,
674
- "Missing LB token for backend address '%s'. The empty token "
675
- "will be used instead",
676
- addr_uri.ok() ? addr_uri->c_str()
677
- : addr_uri.status().ToString().c_str());
673
+ GRPC_TRACE_LOG(glb, INFO)
674
+ << "Missing LB token for backend address '"
675
+ << (addr_uri.ok() ? *addr_uri : addr_uri.status().ToString())
676
+ << "'. The empty token will be used instead";
678
677
  }
679
678
  // Return address with a channel arg containing LB token and stats object.
680
679
  callback(EndpointAddresses(
@@ -852,12 +851,12 @@ void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
852
851
  client_stats = parent()->lb_calld_->client_stats()->Ref();
853
852
  }
854
853
  if (GRPC_TRACE_FLAG_ENABLED(glb)) {
855
- gpr_log(GPR_INFO,
856
- "[grpclb %p helper %p] state=%s (%s) wrapping child "
857
- "picker %p (serverlist=%p, client_stats=%p)",
858
- parent(), this, ConnectivityStateName(state),
859
- status.ToString().c_str(), picker.get(), serverlist.get(),
860
- client_stats.get());
854
+ GRPC_TRACE_LOG(glb, INFO)
855
+ << "[grpclb " << parent() << " helper " << this
856
+ << "] state=" << ConnectivityStateName(state) << " ("
857
+ << status.ToString() << ") wrapping child picker " << picker.get()
858
+ << " (serverlist=" << serverlist.get()
859
+ << ", client_stats=" << client_stats.get() << ")";
861
860
  }
862
861
  parent()->channel_control_helper()->UpdateState(
863
862
  state, status,
data/src/core/util/log.cc CHANGED
@@ -70,10 +70,10 @@ int gpr_should_log(gpr_log_severity severity) {
70
70
  // MinLogLevel is. We could have saved this in a static const variable.
71
71
  // But decided against it just in case anyone programatically sets absl
72
72
  // min log level settings after this has been initialized.
73
- // Same holds for VLOG_IS_ON(2).
73
+ // Same holds for ABSL_VLOG_IS_ON(2).
74
74
  return absl::MinLogLevel() <= absl::LogSeverityAtLeast::kInfo;
75
75
  case GPR_LOG_SEVERITY_DEBUG:
76
- return VLOG_IS_ON(2);
76
+ return ABSL_VLOG_IS_ON(2);
77
77
  default:
78
78
  DLOG(ERROR) << "Invalid gpr_log_severity.";
79
79
  return true;
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.65.1'
17
+ VERSION = '1.65.2'
18
18
  end
@@ -507,11 +507,9 @@ int CBS_get_asn1_int64(CBS *cbs, int64_t *out) {
507
507
  return 0;
508
508
  }
509
509
  uint8_t sign_extend[sizeof(int64_t)];
510
- memset(sign_extend, is_negative ? 0xff : 0, sizeof(sign_extend));
511
- for (size_t i = 0; i < len; i++) {
512
- sign_extend[i] = data[len - i - 1];
513
- }
514
- memcpy(out, sign_extend, sizeof(sign_extend));
510
+ OPENSSL_memset(sign_extend, is_negative ? 0xff : 0, sizeof(sign_extend));
511
+ OPENSSL_memcpy(sign_extend + sizeof(int64_t) - len, data, len);
512
+ *out = CRYPTO_load_u64_be(sign_extend);
515
513
  return 1;
516
514
  }
517
515
 
@@ -41,6 +41,13 @@ static_assert(alignof(union evp_aead_ctx_st_state) >=
41
41
 
42
42
  static int aead_chacha20_poly1305_init(EVP_AEAD_CTX *ctx, const uint8_t *key,
43
43
  size_t key_len, size_t tag_len) {
44
+ // TODO(crbug.com/42290548): The x86_64 assembly depends on initializing
45
+ // |OPENSSL_ia32cap_P|. Move the dispatch to C. While we're here, it may be
46
+ // worth adjusting the assembly calling convention. The assembly functions do
47
+ // too much work right now. For now, explicitly initialize |OPENSSL_ia32cap_P|
48
+ // first.
49
+ OPENSSL_init_cpuid();
50
+
44
51
  struct aead_chacha20_poly1305_ctx *c20_ctx =
45
52
  (struct aead_chacha20_poly1305_ctx *)&ctx->state;
46
53
 
@@ -143,6 +143,9 @@ void OPENSSL_cpuid_setup(void) {
143
143
 
144
144
  int CRYPTO_has_broken_NEON(void) { return 0; }
145
145
 
146
- int CRYPTO_needs_hwcap2_workaround(void) { return g_needs_hwcap2_workaround; }
146
+ int CRYPTO_needs_hwcap2_workaround(void) {
147
+ OPENSSL_init_cpuid();
148
+ return g_needs_hwcap2_workaround;
149
+ }
147
150
 
148
151
  #endif // OPENSSL_ARM && OPENSSL_LINUX && !OPENSSL_STATIC_ARMCAP
@@ -208,15 +208,6 @@ void OPENSSL_cpuid_setup(void) {
208
208
  // Reserved bit #30 is repurposed to signal an Intel CPU.
209
209
  if (is_intel) {
210
210
  edx |= (1u << 30);
211
-
212
- // Clear the XSAVE bit on Knights Landing to mimic Silvermont. This enables
213
- // some Silvermont-specific codepaths which perform better. See OpenSSL
214
- // commit 64d92d74985ebb3d0be58a9718f9e080a14a8e7f and
215
- // |CRYPTO_cpu_perf_is_like_silvermont|.
216
- if ((eax & 0x0fff0ff0) == 0x00050670 /* Knights Landing */ ||
217
- (eax & 0x0fff0ff0) == 0x00080650 /* Knights Mill (per SDE) */) {
218
- ecx &= ~(1u << 26);
219
- }
220
211
  } else {
221
212
  edx &= ~(1u << 30);
222
213
  }
@@ -251,12 +242,6 @@ void OPENSSL_cpuid_setup(void) {
251
242
  extended_features[0] &= ~(1u << 16);
252
243
  }
253
244
 
254
- // Disable ADX instructions on Knights Landing. See OpenSSL commit
255
- // 64d92d74985ebb3d0be58a9718f9e080a14a8e7f.
256
- if ((ecx & (1u << 26)) == 0) {
257
- extended_features[0] &= ~(1u << 19);
258
- }
259
-
260
245
  OPENSSL_ia32cap_P[0] = edx;
261
246
  OPENSSL_ia32cap_P[1] = ecx;
262
247
  OPENSSL_ia32cap_P[2] = extended_features[0];