From f00dfb0f786a1483051a185e41321b9e21bb1f26 Mon Sep 17 00:00:00 2001 From: gRPC Team Bot Date: Thu, 16 May 2024 14:28:46 -0700 Subject: [PATCH] Automated rollback of commit bb201db996dc01209013ee18dd561894983adedd. PiperOrigin-RevId: 634530149 --- src/core/lib/event_engine/ares_resolver.cc | 5 ++--- .../lib/event_engine/posix_engine/ev_epoll1_linux.cc | 9 ++++----- src/core/lib/event_engine/posix_engine/posix_endpoint.cc | 7 +++---- src/core/lib/event_engine/posix_engine/posix_endpoint.h | 3 +-- src/core/lib/event_engine/posix_engine/posix_engine.cc | 3 +-- .../posix_engine/posix_engine_listener_utils.cc | 5 ++--- .../lib/event_engine/posix_engine/tcp_socket_utils.cc | 5 ++--- .../lib/event_engine/posix_engine/traced_buffer_list.cc | 3 +-- .../thread_pool/work_stealing_thread_pool.cc | 5 ++--- 9 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/core/lib/event_engine/ares_resolver.cc b/src/core/lib/event_engine/ares_resolver.cc index 58df73794b9..4273616642c 100644 --- a/src/core/lib/event_engine/ares_resolver.cc +++ b/src/core/lib/event_engine/ares_resolver.cc @@ -53,7 +53,6 @@ #include "absl/functional/any_invocable.h" #include "absl/hash/hash.h" #include "absl/log/check.h" -#include "absl/log/log.h" #include "absl/strings/match.h" #include "absl/strings/numbers.h" #include "absl/strings/str_cat.h" @@ -201,7 +200,7 @@ AresResolver::CreateAresResolver( ares_channel channel; int status = ares_init_options(&channel, &opts, ARES_OPT_FLAGS); if (status != ARES_SUCCESS) { - LOG(ERROR) << "ares_init_options failed, status: " << status; + gpr_log(GPR_ERROR, "ares_init_options failed, status: %d", status); return AresStatusToAbslStatus( status, absl::StrCat("Failed to init c-ares channel: ", ares_strerror(status))); @@ -770,7 +769,7 @@ void AresResolver::OnTXTDoneLocked(void* arg, int status, int /*timeouts*/, result.size()); if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_ares_resolver)) { for (const auto& record : result) { - LOG(INFO) << record; + gpr_log(GPR_INFO, "%s", record.c_str()); } } // Clean up. diff --git a/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc b/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc index bf9c82367fb..a1fffc0a7f9 100644 --- a/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +++ b/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc @@ -19,7 +19,6 @@ #include #include "absl/log/check.h" -#include "absl/log/log.h" #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/str_format.h" @@ -165,14 +164,14 @@ int EpollCreateAndCloexec() { #ifdef GRPC_LINUX_EPOLL_CREATE1 int fd = epoll_create1(EPOLL_CLOEXEC); if (fd < 0) { - LOG(ERROR) << "epoll_create1 unavailable"; + gpr_log(GPR_ERROR, "epoll_create1 unavailable"); } #else int fd = epoll_create(MAX_EPOLL_EVENTS); if (fd < 0) { - LOG(ERROR) << "epoll_create unavailable"; + gpr_log(GPR_ERROR, "epoll_create unavailable"); } else if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) { - LOG(ERROR) << "fcntl following epoll_create failed"; + gpr_log(GPR_ERROR, "fcntl following epoll_create failed"); return -1; } #endif @@ -357,7 +356,7 @@ Epoll1Poller::Epoll1Poller(Scheduler* scheduler) wakeup_fd_ = *CreateWakeupFd(); CHECK(wakeup_fd_ != nullptr); CHECK_GE(g_epoll_set_.epfd, 0); - LOG(INFO) << "grpc epoll fd: " << g_epoll_set_.epfd; + gpr_log(GPR_INFO, "grpc epoll fd: %d", g_epoll_set_.epfd); struct epoll_event ev; ev.events = static_cast(EPOLLIN | EPOLLET); ev.data.ptr = wakeup_fd_.get(); diff --git a/src/core/lib/event_engine/posix_engine/posix_endpoint.cc b/src/core/lib/event_engine/posix_engine/posix_endpoint.cc index 18d7dfb4623..7c8dd72052a 100644 --- a/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +++ b/src/core/lib/event_engine/posix_engine/posix_endpoint.cc @@ -27,7 +27,6 @@ #include "absl/functional/any_invocable.h" #include "absl/log/check.h" -#include "absl/log/log.h" #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" @@ -719,7 +718,7 @@ bool PosixEndpointImpl::ProcessErrors() { return processed_err; } if (GPR_UNLIKELY((msg.msg_flags & MSG_CTRUNC) != 0)) { - LOG(ERROR) << "Error message was truncated."; + gpr_log(GPR_ERROR, "Error message was truncated."); } if (msg.msg_controllen == 0) { @@ -814,7 +813,7 @@ struct cmsghdr* PosixEndpointImpl::ProcessTimestamp(msghdr* msg, auto serr = reinterpret_cast(CMSG_DATA(next_cmsg)); if (serr->ee_errno != ENOMSG || serr->ee_origin != SO_EE_ORIGIN_TIMESTAMPING) { - LOG(ERROR) << "Unexpected control message"; + gpr_log(GPR_ERROR, "Unexpected control message"); return cmsg; } traced_buffers_.ProcessTimestamp(serr, opt_stats, tss); @@ -1304,7 +1303,7 @@ PosixEndpointImpl::PosixEndpointImpl(EventHandle* handle, if (setsockopt(fd_, SOL_SOCKET, SO_ZEROCOPY, &enable, sizeof(enable)) != 0) { zerocopy_enabled = false; - LOG(ERROR) << "Failed to set zerocopy options on the socket."; + gpr_log(GPR_ERROR, "Failed to set zerocopy options on the socket."); } } diff --git a/src/core/lib/event_engine/posix_engine/posix_endpoint.h b/src/core/lib/event_engine/posix_engine/posix_endpoint.h index 9a0ca6b8db4..c85c81e1eb1 100644 --- a/src/core/lib/event_engine/posix_engine/posix_endpoint.h +++ b/src/core/lib/event_engine/posix_engine/posix_endpoint.h @@ -30,7 +30,6 @@ #include "absl/functional/any_invocable.h" #include "absl/hash/hash.h" #include "absl/log/check.h" -#include "absl/log/log.h" #include "absl/status/status.h" #include "absl/status/statusor.h" @@ -184,7 +183,7 @@ class TcpZerocopySendCtx { if (send_records_ == nullptr || free_send_records_ == nullptr) { gpr_free(send_records_); gpr_free(free_send_records_); - LOG(INFO) << "Disabling TCP TX zerocopy due to memory pressure.\n"; + gpr_log(GPR_INFO, "Disabling TCP TX zerocopy due to memory pressure.\n"); memory_limited_ = true; enabled_ = false; } else { diff --git a/src/core/lib/event_engine/posix_engine/posix_engine.cc b/src/core/lib/event_engine/posix_engine/posix_engine.cc index f5c1bf6c3d2..189866faa73 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine.cc +++ b/src/core/lib/event_engine/posix_engine/posix_engine.cc @@ -26,7 +26,6 @@ #include "absl/cleanup/cleanup.h" #include "absl/functional/any_invocable.h" #include "absl/log/check.h" -#include "absl/log/log.h" #include "absl/status/status.h" #include "absl/strings/match.h" #include "absl/strings/str_cat.h" @@ -232,7 +231,7 @@ void AsyncConnect::OnWritable(absl::Status status) // your program or another program on the same computer // opened too many network connections. The "easy" fix: // don't do that! - LOG(ERROR) << "kernel out of buffers"; + gpr_log(GPR_ERROR, "kernel out of buffers"); mu_.Unlock(); fd->NotifyOnWrite(on_writable_); // Don't run the cleanup function for this case. diff --git a/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc b/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc index ebcbec1771b..cbd8902d325 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc +++ b/src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc @@ -23,7 +23,6 @@ #include "absl/cleanup/cleanup.h" #include "absl/log/check.h" -#include "absl/log/log.h" #include "absl/status/status.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_replace.h" @@ -157,7 +156,7 @@ absl::Status PrepareSocket(const PosixTcpOptions& options, #ifdef GRPC_LINUX_ERRQUEUE if (!socket.sock.SetSocketZeroCopy().ok()) { // it's not fatal, so just log it. - VLOG(2) << "Node does not support SO_ZEROCOPY, continuing."; + gpr_log(GPR_DEBUG, "Node does not support SO_ZEROCOPY, continuing."); } else { socket.zero_copy_enabled = true; } @@ -245,7 +244,7 @@ absl::StatusOr ListenerContainerAddAllLocalAddresses( auto result = GetUnusedPort(); GRPC_RETURN_IF_ERROR(result.status()); requested_port = *result; - VLOG(2) << "Picked unused port " << requested_port; + gpr_log(GPR_DEBUG, "Picked unused port %d", requested_port); } if (getifaddrs(&ifa) != 0 || ifa == nullptr) { return absl::FailedPreconditionError( diff --git a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc index 987a010084c..d2cf5f6f426 100644 --- a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +++ b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc @@ -18,7 +18,6 @@ #include #include "absl/cleanup/cleanup.h" -#include "absl/log/log.h" #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/types/optional.h" @@ -654,7 +653,7 @@ void PosixSocketWrapper::TrySetSocketTcpUserTimeout( } if (newval != timeout) { // Do not fail on failing to set TCP_USER_TIMEOUT - LOG(ERROR) << "Failed to set TCP_USER_TIMEOUT"; + gpr_log(GPR_ERROR, "Failed to set TCP_USER_TIMEOUT"); return; } } @@ -685,7 +684,7 @@ bool PosixSocketWrapper::IsIpv6LoopbackAvailable() { int fd = socket(AF_INET6, SOCK_STREAM, 0); bool loopback_available = false; if (fd < 0) { - LOG(INFO) << "Disabling AF_INET6 sockets because socket() failed."; + gpr_log(GPR_INFO, "Disabling AF_INET6 sockets because socket() failed."); } else { sockaddr_in6 addr; memset(&addr, 0, sizeof(addr)); diff --git a/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc b/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc index 1171cb76624..314e451c664 100644 --- a/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +++ b/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc @@ -22,7 +22,6 @@ #include #include "absl/functional/any_invocable.h" -#include "absl/log/log.h" #include #include @@ -49,7 +48,7 @@ void FillGprFromTimestamp(gpr_timespec* gts, const struct timespec* ts) { void DefaultTimestampsCallback(void* /*arg*/, Timestamps* /*ts*/, absl::Status /*shudown_err*/) { - VLOG(2) << "Timestamps callback has not been registered"; + gpr_log(GPR_DEBUG, "Timestamps callback has not been registered"); } // The saved callback function that will be invoked when we get all the diff --git a/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc b/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc index f22f9484d32..eeaed8abb3c 100644 --- a/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc +++ b/src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc @@ -27,7 +27,6 @@ #include "absl/functional/any_invocable.h" #include "absl/log/check.h" -#include "absl/log/log.h" #include "absl/time/clock.h" #include "absl/time/time.h" #include "absl/types/optional.h" @@ -268,7 +267,7 @@ void WorkStealingThreadPool::WorkStealingThreadPoolImpl::StartThread() { } void WorkStealingThreadPool::WorkStealingThreadPoolImpl::Quiesce() { - LOG(INFO) << "WorkStealingThreadPoolImpl::Quiesce"; + gpr_log(GPR_INFO, "WorkStealingThreadPoolImpl::Quiesce"); SetShutdown(true); // Wait until all threads have exited. // Note that if this is a threadpool thread then we won't exit this thread @@ -320,7 +319,7 @@ bool WorkStealingThreadPool::WorkStealingThreadPoolImpl::IsQuiesced() { } void WorkStealingThreadPool::WorkStealingThreadPoolImpl::PrepareFork() { - LOG(INFO) << "WorkStealingThreadPoolImpl::PrepareFork"; + gpr_log(GPR_INFO, "WorkStealingThreadPoolImpl::PrepareFork"); SetForking(true); work_signal_.SignalAll(); auto threads_were_shut_down = living_thread_count_.BlockUntilThreadCount(