Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • About Bonfire
Stefan Eissing
Stefan Eissing
@icing@chaos.social  ·  activity timestamp 11 hours ago

Working on new thread pools for #curl to rework the async DNS resolving. This will be useful for performance and resource control, as well as improved happy eyeballing.

This all because simply calling ‚getaddrinfo‘ is not good enough and replacements like c-ares are never 100% compatible to all the quirks that exist „below“ getaddrinfo.

So, here we go.💃

(Writing threaded code always makes me feel real good about myself until it all blows up in my face. So, fun!😌)

  • Copy link
  • Flag this post
  • Block
Laurent Bercot
Laurent Bercot
@ska@social.treehouse.systems replied  ·  activity timestamp 11 hours ago

@icing What would you list as "quirks that exist below getaddrinfo"?

I'm asking because I find that getaddrinfo is a terrible interface (worse than the libc average, which is saying a lot) and have written my own DNS library, including an interface for asynchronous resolution, and am curious whether you found the same flaws as I did or if your assessment is entirely different 😅

  • Copy link
  • Flag this comment
  • Block
Stefan Eissing
Stefan Eissing
@icing@chaos.social replied  ·  activity timestamp 10 hours ago

@ska The real expert on that is @bagder. From what I know, the system resolvers are often highly configurable on platforms, including loading dynamic modules and that makes it near impossible to replicate in another library.

  • Copy link
  • Flag this comment
  • Block
Petr Menšík :fedora:
Petr Menšík :fedora:
@pemensik@fosstodon.org replied  ·  activity timestamp 10 hours ago

@icing @ska @bagder yeah. getaddrinfo can be provided from multiple sources, not only DNS. I think better async API is needed, still protocol independent. No DNS-exclusive library can replace it.

  • Copy link
  • Flag this comment
  • Block
Laurent Bercot
Laurent Bercot
@ska@social.treehouse.systems replied  ·  activity timestamp 8 hours ago

@pemensik @icing Indeed getaddrinfo performs NSS resolution, not direct DNS resolution, so it typically goes through nsswitch. @bagder, do you happen to have statistics on the usage of not-DNS getaddrinfo in curl? How tied to NSS are people nowadays, would a DNS-only approach be viable?

  • Copy link
  • Flag this comment
  • Block
daniel:// stenberg://
daniel:// stenberg://
@bagder@mastodon.social replied  ·  activity timestamp 8 hours ago

@ska @pemensik @icing /etc/hosts is a major source for address data too, and not DNS - but no, we don't have stats

  • Copy link
  • Flag this comment
  • Block
daniel:// stenberg://
daniel:// stenberg://
@bagder@mastodon.social replied  ·  activity timestamp 9 hours ago

@pemensik @icing @ska c-ares has a plug-in replacement implementation for getaddrinfo() but still after some twenty years or so we have not managed to make it 100% compatible with glibc's version, which ultimately makes it not used by for example Linux distros as a resolver engine for curl.

But I will admit that by now it has been a few years since anyone did such test.

  • Copy link
  • Flag this comment
  • Block

BT Free Social

BT Free is a non-profit organization founded by @ozoned@btfree.social . It's goal is for digital privacy rights, advocacy and consulting. This goal will be attained by hosting open platforms to allow others to seamlessly join the Fediverse on moderated instances or by helping others join the Fediverse.

BT Free Social: About · Code of conduct · Privacy ·
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Code of Conduct