-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Giant v2 rewrite issue #652
Comments
@miekg Just a quick note, on the subject of out-of-order TCP handling, |
Hijack is now used for AXFR and other longer running ops on TCP. That prolly needs a bit of a rethink |
[ Quoting <notifications@github.com> in "Re: [miekg/dns] The Giant v2 rewrit..." ]
@miekg Are there examples of how that's being done in the wild? I've been trying to shoe-horn #646 into #653 and the two stumbling blocks are `Close` and `Hijack`, I don't think it's really possible to solve #646 without either eliminating those two methods or changing their semantics.
I do this in coredns' secondary code, Hijack to later close - not sure how
useful/needed this *actually* is.
|
|
Roundtripper can be done in the current code base; but maybe we should open an v2 branch and hack a bit on it? |
Even if we have a troundtripper I need to double check in the http package if that would automatically means the server also supports it. |
@miekg This library should probably also be ported from a vendor solution to go.mod. That might be worth doing now, I’m not sure how much work that might be to port and maintain. (It may well make building v2 easier). |
[ Quoting <notifications@github.com> in "Re: [miekg/dns] The Giant v2 rewrit..." ]
@miekg This library should probably also be ported from a vendor solution to go.mod. That might be worth doing now, I’m not sure how much work that might be to port and maintain. (It may well make building v2 easier).
Yes, totally. I still need to play with vgo myself. Also considering our 2 major
releases supported, we might need to wait until 1.12
|
@miekg I haven't used vgo/go-modules yet, but I did follow along with the development of it and go1.10.3 (with golang/go#25069) should have minimal backward compatibility support. There should be no problem adding module support and keeping backward compatibility, so I don't think we need to wait to go1.12. |
Another: all constants should be type-safe and not uint8s or untyped. |
I'd really like to see the handling of domain names changed. Currently type Name struct {
Data [nameLen]byte
Length uint8
} Where we (and x/net/dns/dnsmessage) use the presentation format for the domain (including escaping which can cause non-optimal compression†), I'd like our So our name would be stored as: "www.example.org." -> "\x03www\x07example\x03org\x00" That would make packing simply a search for compression points and then a †: "a.example.org" and "a.ex\097mple.org" are the same name, but will end up as different entries in the compression map. Escaping is also the cause of several differences (bugs) between the packing code and the compressed |
Yes and no.
So.. this has some history. When developing ldns back in the day we opted for
wireformat. This meant you need to reimplement the string library to make it
work correctly. Which in C is not too bad, because you don't have strings
anyway.
I choose not to do this for this lib, so "a" + "." + "example.org." will work.
Yes this puts enormous effort upon us (maintainers) to make this work properly,
but the trade-off is just 'strings' for our users.
Was this the correct choice? Maybe? No? Yes? Did this make the API easy, yes.
I think the killer usability feature of this library is/has been the use of
native types. Would I do it again... Maybe...
Fiddling and questioning this is perfectly valid; but you're creating a different
beast.
…--
Miek Gieben
|
In particular replacing I have an idea how this might be possible with the existing implementation. I’ll try that out, but it can’t help other calls. |
closing, someone might re-open when actually work is done |
Issue filed to thing about and flesh out ideas about a possible v2 (re?)write. Keep stuff that is good; throw away things that are bad. I'm not a fan of a big bang move; or something that different for the sake of being different.
One general thing is probably that much more should be pluggeable by means of having an interface. The newer dns transport layer also show the the net/http/RoundTripper interface, instead of the simple
Net
member in Client.Server side is OK(ish?), but can also use a more pluggeable interface. dns.ResponseWriter may need to give guarantees about concurrent use (out-of-order TCP handling) brings this up
Another discussion point would be if we want to keep wireformat around
Looks a x/net/dns and see what's happening there.
The text was updated successfully, but these errors were encountered: