Automated rollback of commit 2d2d5a3c41.

PiperOrigin-RevId: 634556450
pull/36647/head
Vignesh Babu 7 months ago committed by Copybara-Service
parent f00dfb0f78
commit 841dfc097d
  1. 6
      src/core/lib/iomgr/buffer_list.cc
  2. 11
      src/core/lib/iomgr/call_combiner.cc
  3. 4
      src/core/lib/iomgr/ev_epoll1_linux.cc
  4. 7
      src/core/lib/iomgr/ev_poll_posix.cc
  5. 3
      src/core/lib/iomgr/ev_posix.cc
  6. 5
      src/core/lib/iomgr/event_engine_shims/endpoint.cc
  7. 4
      src/core/lib/iomgr/fork_windows.cc
  8. 6
      src/core/lib/iomgr/internal_errqueue.cc
  9. 3
      src/core/lib/iomgr/iocp_windows.cc
  10. 5
      src/core/lib/iomgr/socket_utils_common_posix.cc
  11. 3
      src/core/lib/iomgr/socket_windows.cc
  12. 3
      src/core/lib/iomgr/tcp_client_posix.cc
  13. 8
      src/core/lib/iomgr/tcp_posix.cc
  14. 3
      src/core/lib/iomgr/tcp_server_utils_posix_common.cc
  15. 3
      src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
  16. 7
      src/core/lib/iomgr/tcp_server_windows.cc
  17. 19
      src/core/lib/iomgr/timer_manager.cc

@ -18,8 +18,6 @@
#include "src/core/lib/iomgr/buffer_list.h"
#include "absl/log/log.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
@ -44,7 +42,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
@ -323,7 +321,7 @@ void grpc_tcp_set_write_timestamps_callback(
// Can't comment out the name because some compilers and formatters don't
// like the sequence */* , which would arise from */*fn*/.
(void)fn;
VLOG(2) << "Timestamps callback is not enabled for this platform";
gpr_log(GPR_DEBUG, "Timestamps callback is not enabled for this platform");
}
} // namespace grpc_core

@ -21,7 +21,6 @@
#include <inttypes.h>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
@ -131,13 +130,13 @@ void CallCombiner::Start(grpc_closure* closure, grpc_error_handle error,
}
if (prev_size == 0) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
LOG(INFO) << " EXECUTING IMMEDIATELY";
gpr_log(GPR_INFO, " EXECUTING IMMEDIATELY");
}
// Queue was empty, so execute this closure immediately.
ScheduleClosure(closure, error);
} else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
LOG(INFO) << " QUEUING";
gpr_log(GPR_INFO, " QUEUING");
}
// Queue was not empty, so add closure to queue.
closure->error_data.error = internal::StatusAllocHeapPtr(error);
@ -161,7 +160,7 @@ void CallCombiner::Stop(DEBUG_ARGS const char* reason) {
if (prev_size > 1) {
while (true) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
LOG(INFO) << " checking queue";
gpr_log(GPR_INFO, " checking queue");
}
bool empty;
grpc_closure* closure =
@ -170,7 +169,7 @@ void CallCombiner::Stop(DEBUG_ARGS const char* reason) {
// This can happen either due to a race condition within the mpscq
// code or because of a race with Start().
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
LOG(INFO) << " queue returned no result; checking again";
gpr_log(GPR_INFO, " queue returned no result; checking again");
}
continue;
}
@ -185,7 +184,7 @@ void CallCombiner::Stop(DEBUG_ARGS const char* reason) {
break;
}
} else if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
LOG(INFO) << " queue empty";
gpr_log(GPR_INFO, " queue empty");
}
}

@ -122,7 +122,7 @@ static bool epoll_set_init() {
return false;
}
LOG(INFO) << "grpc epoll fd: " << g_epoll_set.epfd;
gpr_log(GPR_INFO, "grpc epoll fd: %d", g_epoll_set.epfd);
gpr_atm_no_barrier_store(&g_epoll_set.num_events, 0);
gpr_atm_no_barrier_store(&g_epoll_set.cursor, 0);
return true;
@ -1073,7 +1073,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset,
log.push_back(absl::StrFormat(" worker_kick_state=%s",
kick_state_string(specific_worker->state)));
}
VLOG(2) << absl::StrJoin(log, "");
gpr_log(GPR_DEBUG, "%s", absl::StrJoin(log, "").c_str());
}
if (specific_worker == nullptr) {

@ -34,7 +34,6 @@
#include <string>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@ -584,7 +583,7 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) {
static void fd_notify_on_error(grpc_fd* /*fd*/, grpc_closure* closure) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
LOG(ERROR) << "Polling engine does not support tracking errors.";
gpr_log(GPR_ERROR, "Polling engine does not support tracking errors.");
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, absl::CancelledError());
}
@ -603,7 +602,7 @@ static void fd_set_writable(grpc_fd* fd) {
static void fd_set_error(grpc_fd* /*fd*/) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
LOG(ERROR) << "Polling engine does not support tracking errors.";
gpr_log(GPR_ERROR, "Polling engine does not support tracking errors.");
}
}
@ -1398,7 +1397,7 @@ const grpc_event_engine_vtable grpc_ev_poll_posix = {
// check_engine_available =
[](bool) {
if (!grpc_has_wakeup_fd()) {
LOG(ERROR) << "Skipping poll because of no wakeup fd.";
gpr_log(GPR_ERROR, "Skipping poll because of no wakeup fd.");
return false;
}
if (!GRPC_LOG_IF_ERROR("pollset_global_init", pollset_global_init())) {

@ -25,7 +25,6 @@
#include <string.h>
#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h"
@ -110,7 +109,7 @@ static void try_engine(absl::string_view engine) {
if (g_vtables[i] != nullptr && is(engine, g_vtables[i]->name) &&
g_vtables[i]->check_engine_available(engine == g_vtables[i]->name)) {
g_event_engine = g_vtables[i];
VLOG(2) << "Using polling engine: " << g_event_engine->name;
gpr_log(GPR_DEBUG, "Using polling engine: %s", g_event_engine->name);
return;
}
}

@ -19,7 +19,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/string_view.h"
@ -129,7 +128,7 @@ class EventEngineEndpointWrapper {
for (i = 0; i < pending_read_buffer_->count; i++) {
char* dump = grpc_dump_slice(pending_read_buffer_->slices[i],
GPR_DUMP_HEX | GPR_DUMP_ASCII);
VLOG(2) << "READ DATA: " << dump;
gpr_log(GPR_DEBUG, "READ DATA: %s", dump);
gpr_free(dump);
}
}
@ -160,7 +159,7 @@ class EventEngineEndpointWrapper {
for (i = 0; i < slices->count; i++) {
char* dump =
grpc_dump_slice(slices->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII);
VLOG(2) << "WRITE DATA: " << dump;
gpr_log(GPR_DEBUG, "WRITE DATA: %s", dump);
gpr_free(dump);
}
}

@ -22,8 +22,6 @@
#ifndef GRPC_POSIX_FORK
#include "absl/log/log.h"
#include <grpc/fork.h>
#include <grpc/support/log.h>
@ -32,7 +30,7 @@
// AROUND VERY SPECIFIC USE CASES.
//
void grpc_prefork() { LOG(ERROR) << "Forking not supported on Windows"; }
void grpc_prefork() { gpr_log(GPR_ERROR, "Forking not supported on Windows"); }
void grpc_postfork_parent() {}

@ -14,8 +14,6 @@
#include "src/core/lib/iomgr/internal_errqueue.h"
#include "absl/log/log.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
@ -39,7 +37,7 @@ bool KernelSupportsErrqueue() {
// least 4.0.0
struct utsname buffer;
if (uname(&buffer) != 0) {
LOG(ERROR) << "uname: " << StrError(errno);
gpr_log(GPR_ERROR, "uname: %s", StrError(errno).c_str());
return false;
}
char* release = buffer.release;
@ -50,7 +48,7 @@ bool KernelSupportsErrqueue() {
if (strtol(release, nullptr, 10) >= 4) {
return true;
} else {
VLOG(2) << "ERRQUEUE support not enabled";
gpr_log(GPR_DEBUG, "ERRQUEUE support not enabled");
}
#endif // GRPC_LINUX_ERRQUEUE
return false;

@ -27,7 +27,6 @@
#include <limits>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -158,7 +157,7 @@ void grpc_iocp_add_socket(grpc_winsocket* socket) {
(uintptr_t)socket, 0);
if (!ret) {
char* utf8_message = gpr_format_message(WSAGetLastError());
LOG(ERROR) << "Unable to add socket to iocp: " << utf8_message;
gpr_log(GPR_ERROR, "Unable to add socket to iocp: %s", utf8_message);
gpr_free(utf8_message);
__debugbreak();
abort();

@ -44,7 +44,6 @@
#include <string>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/event_engine/endpoint_config.h>
#include <grpc/support/alloc.h>
@ -412,7 +411,7 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout(
}
} else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
LOG(INFO) << "TCP_USER_TIMEOUT not supported for this platform";
gpr_log(GPR_INFO, "TCP_USER_TIMEOUT not supported for this platform");
}
}
return absl::OkStatus();
@ -443,7 +442,7 @@ static void probe_ipv6_once(void) {
int fd = socket(AF_INET6, SOCK_STREAM, 0);
g_ipv6_loopback_available = 0;
if (fd < 0) {
LOG(INFO) << "Disabling AF_INET6 sockets because socket() failed.";
gpr_log(GPR_INFO, "Disabling AF_INET6 sockets because socket() failed.");
} else {
grpc_sockaddr_in6 addr;
memset(&addr, 0, sizeof(addr));

@ -28,7 +28,6 @@
#include <mswsock.h>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_format.h"
#include <grpc/support/alloc.h>
@ -218,7 +217,7 @@ static void probe_ipv6_once(void) {
SOCKET s = socket(AF_INET6, SOCK_STREAM, 0);
g_ipv6_loopback_available = 0;
if (s == INVALID_SOCKET) {
LOG(INFO) << "Disabling AF_INET6 sockets because socket() failed.";
gpr_log(GPR_INFO, "Disabling AF_INET6 sockets because socket() failed.");
} else {
grpc_sockaddr_in6 addr;
memset(&addr, 0, sizeof(addr));

@ -30,7 +30,6 @@
#include "absl/container/flat_hash_map.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include <grpc/support/alloc.h>
@ -241,7 +240,7 @@ static void on_writable(void* acp, grpc_error_handle error) {
// 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");
gpr_mu_unlock(&ac->mu);
grpc_fd_notify_on_write(fd, &ac->write_closure);
return;

@ -875,7 +875,7 @@ static void tcp_trace_read(grpc_tcp* tcp, grpc_error_handle error)
for (i = 0; i < tcp->incoming_buffer->count; i++) {
char* dump = grpc_dump_slice(tcp->incoming_buffer->slices[i],
GPR_DUMP_HEX | GPR_DUMP_ASCII);
VLOG(2) << "READ DATA: " << dump;
gpr_log(GPR_DEBUG, "READ DATA: %s", dump);
gpr_free(dump);
}
}
@ -1853,7 +1853,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */,
tcp->write_cb = nullptr;
tcp->current_zerocopy_send = nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
LOG(INFO) << "write: " << grpc_core::StatusToString(error);
gpr_log(GPR_INFO, "write: %s", grpc_core::StatusToString(error).c_str());
}
// No need to take a ref on error since tcp_flush provides a ref.
grpc_core::Closure::Run(DEBUG_LOCATION, cb, error);
@ -1877,7 +1877,7 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
if (gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
char* data =
grpc_dump_slice(buf->slices[i], GPR_DUMP_HEX | GPR_DUMP_ASCII);
VLOG(2) << "WRITE DATA: " << data;
gpr_log(GPR_DEBUG, "WRITE DATA: %s", data);
gpr_free(data);
}
}
@ -1921,7 +1921,7 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
notify_on_write(tcp);
} else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
LOG(INFO) << "write: " << grpc_core::StatusToString(error);
gpr_log(GPR_INFO, "write: %s", grpc_core::StatusToString(error).c_str());
}
grpc_core::Closure::Run(DEBUG_LOCATION, cb, error);
}

@ -32,7 +32,6 @@
#include <string>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include <grpc/support/alloc.h>
@ -222,7 +221,7 @@ grpc_error_handle grpc_tcp_server_prepare_socket(
err = grpc_set_socket_zerocopy(fd);
if (!err.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.");
}
#endif
err = grpc_set_socket_nonblocking(fd, 1);

@ -31,7 +31,6 @@
#include <string>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include <grpc/support/alloc.h>
@ -116,7 +115,7 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
} else if (requested_port <= 0) {
return GRPC_ERROR_CREATE("Bad get_unused_port()");
}
VLOG(2) << "Picked unused port " << requested_port;
gpr_log(GPR_DEBUG, "Picked unused port %d", requested_port);
}
static bool v4_available = grpc_is_ipv4_availabile();

@ -28,7 +28,6 @@
#include <vector>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/str_cat.h"
#include <grpc/event_engine/endpoint_config.h>
@ -406,7 +405,7 @@ static void on_accept(void* arg, grpc_error_handle error) {
if (!wsa_success) {
if (!sp->shutting_down) {
char* utf8_message = gpr_format_message(WSAGetLastError());
LOG(ERROR) << "on_accept error: " << utf8_message;
gpr_log(GPR_ERROR, "on_accept error: %s", utf8_message);
gpr_free(utf8_message);
}
closesocket(sock);
@ -416,7 +415,7 @@ static void on_accept(void* arg, grpc_error_handle error) {
(char*)&sp->socket->socket, sizeof(sp->socket->socket));
if (err) {
char* utf8_message = gpr_format_message(WSAGetLastError());
LOG(ERROR) << "setsockopt error: " << utf8_message;
gpr_log(GPR_ERROR, "setsockopt error: %s", utf8_message);
gpr_free(utf8_message);
}
int peer_name_len = (int)peer_name.len;
@ -433,7 +432,7 @@ static void on_accept(void* arg, grpc_error_handle error) {
}
} else {
char* utf8_message = gpr_format_message(WSAGetLastError());
LOG(ERROR) << "getpeername error: " << utf8_message;
gpr_log(GPR_ERROR, "getpeername error: %s", utf8_message);
gpr_free(utf8_message);
}
std::string fd_name = absl::StrCat("tcp_server:", peer_name_string);

@ -21,7 +21,6 @@
#include <inttypes.h>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -90,7 +89,7 @@ static void start_timer_thread_and_unlock(void) {
++g_thread_count;
gpr_mu_unlock(&g_mu);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
LOG(INFO) << "Spawn timer thread";
gpr_log(GPR_INFO, "Spawn timer thread");
}
completed_thread* ct =
static_cast<completed_thread*>(gpr_malloc(sizeof(*ct)));
@ -126,7 +125,7 @@ static void run_some_timers() {
// waiter so that the next deadline is not missed
if (!g_has_timed_waiter) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
LOG(INFO) << "kick untimed waiter";
gpr_log(GPR_INFO, "kick untimed waiter");
}
gpr_cv_signal(&g_cv_wait);
}
@ -134,7 +133,7 @@ static void run_some_timers() {
}
// without our lock, flush the exec_ctx
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
LOG(INFO) << "flush exec_ctx";
gpr_log(GPR_INFO, "flush exec_ctx");
}
grpc_core::ExecCtx::Get()->Flush();
gpr_mu_lock(&g_mu);
@ -200,7 +199,7 @@ static bool wait_until(grpc_core::Timestamp next) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace) &&
next == grpc_core::Timestamp::InfFuture()) {
LOG(INFO) << "sleep until kicked";
gpr_log(GPR_INFO, "sleep until kicked");
}
gpr_cv_wait(&g_cv_wait, &g_mu, next.as_timespec(GPR_CLOCK_MONOTONIC));
@ -252,7 +251,7 @@ static void timer_main_loop() {
// Consequently, we can just sleep forever here and be happy at some
// saved wakeup cycles.
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
LOG(INFO) << "timers not checked: expect another thread to";
gpr_log(GPR_INFO, "timers not checked: expect another thread to");
}
next = grpc_core::Timestamp::InfFuture();
ABSL_FALLTHROUGH_INTENDED;
@ -278,7 +277,7 @@ static void timer_thread_cleanup(completed_thread* ct) {
g_completed_threads = ct;
gpr_mu_unlock(&g_mu);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
LOG(INFO) << "End timer thread";
gpr_log(GPR_INFO, "End timer thread");
}
}
@ -319,18 +318,18 @@ void grpc_timer_manager_init(void) {
static void stop_threads(void) {
gpr_mu_lock(&g_mu);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
LOG(INFO) << "stop timer threads: threaded=" << g_threaded;
gpr_log(GPR_INFO, "stop timer threads: threaded=%d", g_threaded);
}
if (g_threaded) {
g_threaded = false;
gpr_cv_broadcast(&g_cv_wait);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
LOG(INFO) << "num timer threads: " << g_thread_count;
gpr_log(GPR_INFO, "num timer threads: %d", g_thread_count);
}
while (g_thread_count > 0) {
gpr_cv_wait(&g_cv_shutdown, &g_mu, gpr_inf_future(GPR_CLOCK_MONOTONIC));
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
LOG(INFO) << "num timer threads: " << g_thread_count;
gpr_log(GPR_INFO, "num timer threads: %d", g_thread_count);
}
gc_completed_threads();
}

Loading…
Cancel
Save