Automated rollback of commit 8697651216.

PiperOrigin-RevId: 603424171
pull/35785/head
Vignesh Babu 10 months ago committed by Copybara-Service
parent 1f979d2a83
commit 3bbe8979d3
  1. 2
      src/core/BUILD
  2. 19
      src/core/ext/transport/chttp2/server/chttp2_server.cc

@ -6288,13 +6288,11 @@ grpc_cc_library(
"closure", "closure",
"error", "error",
"error_utils", "error_utils",
"event_engine_tcp_socket_utils",
"grpc_insecure_credentials", "grpc_insecure_credentials",
"handshaker_registry", "handshaker_registry",
"iomgr_fwd", "iomgr_fwd",
"memory_quota", "memory_quota",
"pollset_set", "pollset_set",
"posix_event_engine_tcp_socket_utils",
"resolved_address", "resolved_address",
"resource_quota", "resource_quota",
"status_helper", "status_helper",

@ -56,8 +56,6 @@
#include "src/core/lib/config/core_configuration.h" #include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/event_engine/channel_args_endpoint_config.h" #include "src/core/lib/event_engine/channel_args_endpoint_config.h"
#include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h"
#include "src/core/lib/event_engine/tcp_socket_utils.h"
#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/ref_counted_ptr.h"
@ -97,8 +95,6 @@ namespace grpc_core {
namespace { namespace {
using ::grpc_event_engine::experimental::EventEngine; using ::grpc_event_engine::experimental::EventEngine;
using ::grpc_event_engine::experimental::PosixSocketWrapper;
using ::grpc_event_engine::experimental::ResolvedAddressToURI;
const char kUnixUriPrefix[] = "unix:"; const char kUnixUriPrefix[] = "unix:";
const char kUnixAbstractUriPrefix[] = "unix-abstract:"; const char kUnixAbstractUriPrefix[] = "unix-abstract:";
@ -1080,25 +1076,12 @@ void grpc_server_add_channel_from_fd(grpc_server* server, int fd,
grpc_core::ChannelArgs server_args = core_server->channel_args(); grpc_core::ChannelArgs server_args = core_server->channel_args();
std::string name = absl::StrCat("fd:", fd); std::string name = absl::StrCat("fd:", fd);
// The fd is going to be registered with the gRPC poller to be asynchronously
// notified for read/write/error events. It must be marked as NonBlocking
// to ensure that the poller/gRPC executor threads do not get blocked on
// the socket when attempting to read/write from it.
grpc_core::PosixSocketWrapper sock(fd);
(void)sock.SetSocketNonBlocking(true);
(void)sock.SetSocketCloexec(true);
(void)sock.SetSocketNoSigpipeIfPossible();
auto peer_address = sock.PeerAddress();
std::string addr_str = name;
if (peer_address.ok()) {
addr_str = *grpc_core::ResolvedAddressToURI(peer_address.value());
}
auto memory_quota = auto memory_quota =
server_args.GetObject<grpc_core::ResourceQuota>()->memory_quota(); server_args.GetObject<grpc_core::ResourceQuota>()->memory_quota();
grpc_endpoint* server_endpoint = grpc_tcp_create_from_fd( grpc_endpoint* server_endpoint = grpc_tcp_create_from_fd(
grpc_fd_create(fd, name.c_str(), true), grpc_fd_create(fd, name.c_str(), true),
grpc_event_engine::experimental::ChannelArgsEndpointConfig(server_args), grpc_event_engine::experimental::ChannelArgsEndpointConfig(server_args),
addr_str); name);
grpc_core::Transport* transport = grpc_create_chttp2_transport( grpc_core::Transport* transport = grpc_create_chttp2_transport(
server_args, server_endpoint, false // is_client server_args, server_endpoint, false // is_client
); );

Loading…
Cancel
Save