Skip to content

Commit

Permalink
fixup: do not close the fds.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneo committed Dec 18, 2024
1 parent 65c7154 commit 1851466
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/core/lib/event_engine/posix_engine/posix_system_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
namespace grpc_event_engine {
namespace experimental {

SystemApi::~SystemApi() {
for (int fd : fds_.Clear()) {
close(fd);
}
}

absl::StatusOr<LockedFd> SystemApi::Lock(FileDescriptor fd) const {
if (!fd.ready()) {
return absl::InternalError("Invalid file descriptor");
Expand Down
2 changes: 0 additions & 2 deletions src/core/lib/event_engine/posix_engine/posix_system_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ class SystemApi {
SystemApi() = default;
SystemApi(const SystemApi& other) = delete;

~SystemApi();

absl::Status AdvanceGeneration();

absl::StatusOr<FileDescriptor> Accept(FileDescriptor sockfd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ EventEngine::ConnectionHandle PosixOracleEventEngine::Connect(
}
} else if (err < 0) {
if (errno != ECONNREFUSED || ++num_retries > kMaxRetries) {
on_connect(absl::CancelledError("Connect failed."));
on_connect(absl::ErrnoToStatus(errno, "Connect failed"));
return {};
}
// If ECONNREFUSED && num_retries < kMaxRetries, wait a while and try
Expand Down
2 changes: 1 addition & 1 deletion test/core/event_engine/test_suite/tests/server_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ TEST_F(EventEngineServerTest,
oracle_ee->Connect(
[&client_endpoint,
&client_signal](absl::StatusOr<std::unique_ptr<Endpoint>> endpoint) {
ASSERT_TRUE(endpoint.ok());
ASSERT_TRUE(endpoint.ok()) << endpoint.status();
client_endpoint = std::move(*endpoint);
client_signal.Notify();
},
Expand Down

0 comments on commit 1851466

Please sign in to comment.