tungd / elixir-dns

DNS library for Elixir
BSD 3-Clause "New" or "Revised" License
114 stars 37 forks source link

Is it safe to rely on Erlang "internal" DNS code? #53

Open bortzmeyer opened 2 years ago

bortzmeyer commented 2 years ago

The library uses Erlang/OTP DNS code. I've been told that, if this Erlang code is undocumented, this is because it it no supposed to be used by external programs, but only by Erlang itself, for its internal use. Do you agree? Would it be better to develop specific code to be independent of Erlang?

tungd commented 2 years ago

Yes that is the case, and it is mentioned explicitly in the README. However, I'd argue that un-documented and internal-use only is just the way the Erlang team telling us they are not interested to develop it/fixing its issue outside of their scopes.

This library, however, is publicly maintained and bug fix / additional extension will be addressed. It's on me and the contributors to fix bugs and maintain compatibility with :inet_dns. In that sense, at least to me, this library is as safe to use in production as Erlang/OTP itself (I do have production code that use this, but only on a small scale). The bottom line is that if you stick to a combination of versions of the library/Erlang/OTP that works, it won't break your code.

Hope that answers your question/concerns. I'm happy to discussing it further.

Hermanverschooten commented 1 year ago

I just ran into an issue with livebook (https://github.com/livebook-dev/livebook/issues/1976), due to this.

josevalim commented 1 year ago

In this case, maybe it makes sense to copy inet_dns.erl and inet_dns.hrl, rename the modules, and keep only the bits that make sense? This way there is no chance you can break in future versions, you don't need to install erlang sources, and it gives you more freedom to evolve over time?

bortzmeyer commented 1 year ago

The elixir-dns library seems unmaintained (see the many open issues, even when this is clearly a bug and has a patch). So, I'm not sure there will be a solution. (Elixir badly needs a properly maintained DNS library.)

josevalim commented 1 year ago

14 open issues is not that many and the last commit was 1 year ago, so I would say the jury is not out there yet. In any case, Hex.pm does have a mechanism to transfer ownership of maintained packages. So I can see two possible options:

  1. Start a fork where those issues are solved and then reach out to Hex.pm
  2. Use an Erlang DNS library, such as https://github.com/dnsimple/dns_erlang (which is maintained by a DNS provider)
bortzmeyer commented 1 year ago

dns_erlang is quite difficult to use for a purely Elixir programmer.