seastar: dns fails due to ECONNREFUSED with c-ares 1.33 and up

in c-ares 1.33, it introduced DNS cookie support, which tracks the local ip in server_connection::self_ip when a socket is created. but in seastar, what we return to c-ares is an index into dns_resolver::impl::_sockets, and the underlying socket is hidden underneath of posix_connected_socket_impl. see https://github.com/c-ares/c-ares/blob/759343ae00bd0dd562f4469ef030a71264ed543e/src/lib/ares_conn.c#L144-L154

so when c-ares tries to retrieve the socket’s local address in ares_conn_set_self_ip() , getsockname() fails with ENOTSOCK, and ares_conn_set_self_ip() returns ARES_ECONNREFUSED in this case.

please note, fedora 41 comes with c-ares 1.33.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (13 by maintainers)

Commits related to this issue

Most upvoted comments