Include the destination address in synchronous TCP connect errors

pull/22868/head
Alexander Polcyn 5 years ago
parent 06d4be0f19
commit 65fdff3683
  1. 8
      src/core/lib/iomgr/tcp_client_posix.cc

@ -302,9 +302,13 @@ void grpc_tcp_client_create_from_prepared_fd(
return; return;
} }
if (errno != EWOULDBLOCK && errno != EINPROGRESS) { if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
grpc_error* error = GRPC_OS_ERROR(errno, "connect");
char* addr_str = grpc_sockaddr_to_uri(addr);
error = grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
grpc_slice_from_copied_string(addr_str));
gpr_free(addr_str);
grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error"); grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
GRPC_OS_ERROR(errno, "connect"));
return; return;
} }

Loading…
Cancel
Save