| 1 | 17:32 < exarkun> So, I think the thing that makes this difficult is just that Twisted is bad. |
|---|
| 2 | 17:32 < exarkun> Er I mean listenTCP is a bogus API. |
|---|
| 3 | 17:33 < exarkun> Hm |
|---|
| 4 | 17:33 < exarkun> No, I really mean that listenTCP6 is a bogus API. |
|---|
| 5 | 17:33 < exarkun> I didn't actually look at how that is interacting with name resolution. |
|---|
| 6 | 17:33 < exarkun> I assume it is somehow though. |
|---|
| 7 | 17:34 < therve> afaik, the problem is more connectTCP6 |
|---|
| 8 | 17:34 < exarkun> therve: It's the same, although it's more obvious with connectTCP6, yea |
|---|
| 9 | 17:34 < exarkun> IPv4Address(...).connectStream(...) is a good API |
|---|
| 10 | 17:34 < exarkun> Because it lets you do IPv6Address(...).connectStream(...) too |
|---|
| 11 | 17:34 < exarkun> Polymorphism etc! |
|---|
| 12 | 17:34 < therve> yeah, but it's doesn't exist |
|---|
| 13 | 17:34 < exarkun> That's true. |
|---|
| 14 | 17:35 < exarkun> A slightly less good API is |
|---|
| 15 | 17:35 < therve> making that depend on a ticket opened 3 years ago is unfortunate |
|---|
| 16 | 17:35 < exarkun> connectTCP(IPv4Address(...), ...) |
|---|
| 17 | 17:35 < exarkun> since it lets you do connectTCP(IPv6Address(...), ...) |
|---|
| 18 | 17:35 < exarkun> (Or connectTCP(UNIXAddress(...), ...)) |
|---|
| 19 | 17:35 < radix> or Hostname(...).toIPv6Address() |
|---|
| 20 | 17:35 < glyph> :-( |
|---|
| 21 | 17:36 < exarkun> radix: Really? |
|---|
| 22 | 17:36 < radix> exarkun: probably not. The weird thing about it is that it would return a Deferred. |
|---|
| 23 | 17:36 < radix> and you probably don't want a connect method that takes a deferred. |
|---|
| 24 | 17:36 < exarkun> Well! That's interesting. |
|---|
| 25 | 17:36 < glyph> is an IPv6 socket a fundamentally different thing from an IPv4 socket? |
|---|
| 26 | 17:36 < exarkun> You could argue that connectTCP('hostname', ...) is insane. |
|---|
| 27 | 17:36 < radix> So it'd be Hostname(...).toIPv6Address().addCallback(connectTCP, ...) |
|---|
| 28 | 17:36 < exarkun> glyph: Those words are missing semantics, I think. |
|---|
| 29 | 17:37 < glyph> exarkun: I am missing the semantics in my brain why is why I didn't put them in the words. |
|---|
| 30 | 17:37 < exarkun> Or I could say "IPv6 socket is a nonsensical concept, don't say that ever again" |
|---|
| 31 | 17:37 < exarkun> The underlying BSD socket API makes it really clear what the high-level abstraction should be |
|---|
| 32 | 17:37 < glyph> what's the underlying API? |
|---|
| 33 | 17:38 < exarkun> socket(domain, type, protocol) |
|---|
| 34 | 17:38 < glyph> oh, that API. |
|---|
| 35 | 17:38 < radix> what's the clear thing? :) |
|---|
| 36 | 17:39 < exarkun> The clear thing is that there's a domain and a type (and we'll ignore protocol! because who cares) |
|---|
| 37 | 17:39 < exarkun> So the high-level abstraction should have a domain and a type |
|---|
| 38 | 17:39 < radix> ok, I always forget which of those things you're supposed to ignore :) |
|---|
| 39 | 17:39 < exarkun> connectTCP makes it hard to support IPv6 because it smashes domain and type into one thing |
|---|
| 40 | 17:40 < exarkun> connectTCP in Twisted right now is really connectTCPIPv4, and if you want IPv6 you need connectTCPIPv6 |
|---|
| 41 | 17:40 < exarkun> and that's ridiculous |
|---|
| 42 | 17:40 < exarkun> and you don't even have to look at ipv6 to see how it's ridiculous |
|---|
| 43 | 17:40 < exarkun> because connectUNIX is the same crummy thing |
|---|
| 44 | 17:40 < exarkun> So the high-level abstraction should let you talk about domains separately from types |
|---|
| 45 | 17:41 < exarkun> and it doesn't do that in a good way right now |
|---|
| 46 | 17:41 < radix> exarkun: maybe connectTCP is still a nice convenience API to have, especially if it will either use IPv6 or IPv4, automatically. |
|---|
| 47 | 17:41 < exarkun> sure, that's the connectTCP({IPv4,IPv6,UNIX}Address(...), ...) case |
|---|
| 48 | 17:41 < glyph> right, how do you *tell* if you want to use IPv6 or IPv4 though |
|---|
| 49 | 17:41 < exarkun> Yes, another good question! |
|---|
| 50 | 17:41 < radix> exarkun: no, I mean connectTCP(string, ...) |
|---|
| 51 | 17:42 < exarkun> radix: whatever, same difference, hang on a sec |
|---|
| 52 | 17:42 < dash> glyph: simple - you don't ever want ipv6 |
|---|
| 53 | 17:42 < exarkun> if you have a "string", then you're thinking about the same thing glyph is thinking about |
|---|
| 54 | 17:42 < radix> I will hang on, but it doesn't sound like the same thing :) |
|---|
| 55 | 17:42 * dash runs away |
|---|
| 56 | 17:42 < exarkun> except again you don't have to bring ipv6 into it to get the problem |
|---|
| 57 | 17:43 < exarkun> if you pass "example.org" to connectTCP and there's two A records associated with example.org, which do you use? |
|---|
| 58 | 17:43 < radix> holy shit, is it raining? |
|---|
| 59 | 17:43 < exarkun> the way it works now, you make an arbitrary decision, which is a bad thing for the lowest-level api to do. |
|---|
| 60 | 17:43 < radix> worse! it's deathing |
|---|
| 61 | 17:43 < radix> exarkun: yeah, definitely. |
|---|
| 62 | 17:44 < exarkun> so is it any worse if you make the arbitrary decision between two A records, an A6 record, and three AAAA records? |
|---|
| 63 | 17:44 < radix> exarkun: I was kind of proposing connectTCP becoming a higher level API, while maintaining the same name and signature. |
|---|
| 64 | 17:44 < glyph> radix: it's *deathing*? |
|---|
| 65 | 17:44 < exarkun> radix: that might be a good idea. in any case, disallowing a string to connectTCP now is probably not a good idea. |
|---|
| 66 | 17:44 < radix> glyph: sleet |
|---|
| 67 | 17:44 < radix> exarkun: yeah :) |
|---|
| 68 | 17:45 < radix> exarkun: I guess the thing I'm trying to figure out is whether we should also have it look up an A6 record for that string in the future |
|---|
| 69 | 17:45 < exarkun> Well |
|---|
| 70 | 17:45 < radix> (or AAAA or whatever TF we're supposed to use) |
|---|
| 71 | 17:45 < exarkun> Turns out |
|---|
| 72 | 17:45 < exarkun> This is pretty funny really |
|---|
| 73 | 17:45 < radix> heh |
|---|
| 74 | 17:45 < glyph> oh no |
|---|
| 75 | 17:45 < radix> are you going to paste that thng |
|---|
| 76 | 17:46 < exarkun> Turns out it has been looking up A6 and AAAA records for years |
|---|
| 77 | 17:46 < radix> blirk |
|---|
| 78 | 17:46 < exarkun> Good thing nobody uses IPv6 or that might've caused some problems. |
|---|
| 79 | 17:47 < radix> so basically Twisted is really slow :) |
|---|
| 80 | 17:47 < exarkun> Nah, it's actually no slower than if it only looked up A records! |
|---|
| 81 | 17:47 < exarkun> However, it is broken (since ANY queries aren't really very good) |
|---|
| 82 | 17:47 < radix> exarkun: did you learn some things about DNS |
|---|
| 83 | 17:47 < radix> exarkun: oh wait, the ANY thing?????? |
|---|
| 84 | 17:47 < exarkun> I learned some things about DNS |
|---|
| 85 | 17:48 < radix> exarkun: SURELY we fixed that |
|---|
| 86 | 17:48 < radix> I discovered the ANY bug like ten *years* ago |
|---|
| 87 | 17:48 < exarkun> It may be that no one ever uses anything but the default resolver |
|---|
| 88 | 17:48 < exarkun> And that's what lets it actually work, I'm not sure |
|---|
| 89 | 17:48 < radix> ah, ok |
|---|
| 90 | 17:48 < radix> exarkun: so, yeah, maybe you don't remember |
|---|
| 91 | 17:48 < radix> exarkun: when I worked for April, I discovered that ANY is something you should never use |
|---|
| 92 | 17:48 < exarkun> Indeed. |
|---|
| 93 | 17:48 < exarkun> But apparently you didn't fix it in Twisted. |
|---|
| 94 | 17:48 < radix> because it often only returns cached values |
|---|
| 95 | 17:49 < radix> exarkun: crap. did I even file a bug? :( |
|---|
| 96 | 17:49 < radix> it's about getHostByName, right? |
|---|
| 97 | 17:49 < exarkun> It's about getHostByName, yes. |
|---|
| 98 | 17:49 < exarkun> I don't remember any ticket related to this. |
|---|
| 99 | 17:49 < radix> yeah. it does an ANY query. dangit. |
|---|
| 100 | 17:49 < radix> I'm sorry. :( |
|---|
| 101 | 17:49 < exarkun> We're wandering from the main point though, I think |
|---|
| 102 | 17:50 < exarkun> which is that there should be an api which parameterizes the domain separately from the type |
|---|
| 103 | 17:50 < exarkun> instead of encoding the type into the method name |
|---|
| 104 | 17:51 < PenguinOfDoom> IReactorInternetInternetInternetInternet |
|---|
| 105 | 17:52 < exarkun> therve: I don't have any idea if that answered any of the interesting questions. |
|---|
| 106 | 17:54 < therve> exarkun: I think for now it mainly raised other questions :/ |
|---|
| 107 | 17:55 < PenguinOfDoom> therve: exarkun is a scientist, not a preacher. That's how all of his explanations are. |
|---|
| 108 | 17:55 < glyph> exarkun: Well, at some point, the correct answer here is "endpoints", right? |
|---|
| 109 | 17:55 < therve> glyph: in your dreams :) |
|---|
| 110 | 17:55 < therve> glyph: this is not only an API issue, unfortunately |
|---|
| 111 | 17:55 < glyph> therve: Twisted *IS* my dream ;-) |
|---|
| 112 | 17:55 < PenguinOfDoom> glyph: Twisted isn't pretend vaporware like endpoints, though. |
|---|
| 113 | 17:56 < PenguinOfDoom> well, mostly |
|---|
| 114 | 17:56 < glyph> OK, so, I think I'm getting lost on the details that are not API issues |
|---|
| 115 | 17:56 < glyph> (or bugs in listenTCP) |
|---|
| 116 | 17:57 < radix> hmm apparently it is called "*" in the RFC, not ANY |
|---|
| 117 | 17:57 < exarkun> indeed |
|---|
| 118 | 17:57 < exarkun> but who cares about the rfc, dig says it's "any" |
|---|
| 119 | 17:58 < radix> exarkun: well yes, I'm just trying to refer to something in an RFC in this ticket I'm filing |
|---|
| 120 | 17:58 < exarkun> radix: ah, excellent |
|---|
| 121 | 17:58 < radix> but it is really hard to find the stuff I need |
|---|
| 122 | 17:58 < exarkun> therve: Since I haven't really looked at the patch in depth, I can't think of any of the non-API issues |
|---|
| 123 | 17:59 < therve> the great thing is that I only spotted that because for some reason os X decides to return IPV6 records first |
|---|
| 124 | 17:59 < glyph> therve: sweeeeet |
|---|
| 125 | 17:59 < exarkun> radix: I can give you a link to some mailing list correspondence to link to from the ticket :) |
|---|
| 126 | 17:59 < glyph> therve: OS X is clearly the OS of the *future* |
|---|
| 127 | 17:59 < PenguinOfDoom> therve: That's because the RFC tells to return IPv6 records first. |
|---|
| 128 | 17:59 < glyph> because in the future the internet will burn down and nothing will work |
|---|
| 129 | 17:59 < glyph> o/` |
|---|
| 130 | 18:00 < exarkun> therve: Oh right, getaddrinfo? |
|---|
| 131 | 18:00 < therve> exarkun: yeah |
|---|
| 132 | 18:00 < exarkun> That part of the change seemed dubious to me. But I'm not sure. |
|---|
| 133 | 18:00 < PenguinOfDoom> glyph: Whatever. In the future, I will be surfing web6 while you are wandering among the ruins of your old crappy internet |
|---|
| 134 | 18:00 < glyph> PenguinOfDoom: you aren't even surfing web 2 yet |
|---|
| 135 | 18:00 < radix> I thought I once read something by djb about */ANY, but I can't find it. The only thing I see that he mentions is about how MX records can be interleaved with other records, and that happens especially often in * queries. |
|---|
| 136 | 18:00 < glyph> no way you're going to get all the way to 6 |
|---|
| 137 | 18:00 < PenguinOfDoom> glyph: Cisco ain't done making the surfboard yet |
|---|
| 138 | 18:00 < therve> exarkun: maybe |
|---|
| 139 | 18:01 < PenguinOfDoom> djb hates the hell out of ipv6 |
|---|
| 140 | 18:01 < exarkun> therve: Isn't a simple solution to not use getaddrinfo for IPv4 connection attempts? |
|---|
| 141 | 18:01 < therve> radix: http://cr.yp.to/djbdns/killa6.html |
|---|
| 142 | 18:01 < therve> exarkun: well, how would you know? |
|---|
| 143 | 18:01 < radix> therve: this isn't about the ipv6 stuff, just about what qtype=* means |
|---|
| 144 | 18:02 < exarkun> therve: connectTCP('a.b.c.d', ...) is an ipv4 connection attempt; connectTCP('a::b', ...) is an ipv6 connection attempt; connectTCP('hostname', ...) is an ipv4 connection attempt |
|---|
| 145 | 18:02 < exarkun> therve: for example |
|---|
| 146 | 18:02 < therve> ah |
|---|
| 147 | 18:02 < therve> that's a solution, indeed |
|---|
| 148 | 18:02 < glyph> connectTCP(_6=True) |
|---|
| 149 | 18:02 < therve> glyph: dieinfirenow |
|---|
| 150 | 18:03 < exarkun> +1 :) |
|---|
| 151 | 18:03 < glyph> more seriously, presumably someone might want connectTCP('hostname', ...) to be IPv6. How do they say that? |
|---|
| 152 | 18:03 < therve> using endpoints! ahah! |
|---|
| 153 | 18:03 < exarkun> Yes. |
|---|
| 154 | 18:03 < exarkun> Or more generally, "using the good API instead of the bad API" |
|---|
| 155 | 18:03 < glyph> I guess that's where I get a little lost. What would the endpoint call, if not connectTCP6 or listenTCP6? |
|---|
| 156 | 18:03 < exarkun> maybe that's endpoints maybe it's something less drastically different |
|---|
| 157 | 18:04 < glyph> I think of endpoints as a higher level API around lower level stuff the reactor is doing. |
|---|
| 158 | 18:04 < glyph> not as a replacement for all of the existing reactor APIs |
|---|
| 159 | 18:04 < exarkun> yes. |
|---|
| 160 | 18:04 < exarkun> you can't do it if it's not implemented by the reactor |
|---|
| 161 | 18:04 < PenguinOfDoom> no :( |
|---|
| 162 | 18:04 < exarkun> but the way the reactor wants to work now is not awesome. |
|---|
| 163 | 18:04 < PenguinOfDoom> endpoints.connectTCP6('ip6porn.com', reactor=ip6reactor) |
|---|
| 164 | 18:05 < exarkun> I would suggest connectTCP(IPv6Address(...), ...) as a better low-level API than connectTCP6(...) |
|---|
| 165 | 18:05 < PenguinOfDoom> wait, that doesn't even begin to make sense :( |
|---|
| 166 | 18:05 < exarkun> PenguinOfDoom: Serious contributions only, please. |
|---|
| 167 | 18:05 < exarkun> PenguinOfDoom: We will have joke time afterwards. |
|---|
| 168 | 18:05 < PenguinOfDoom> :( |
|---|
| 169 | 18:05 < PenguinOfDoom> Okay, do I bring SCTP up now or during joke time? |
|---|
| 170 | 18:05 < exarkun> PenguinOfDoom: joke time |
|---|
| 171 | 18:05 < PenguinOfDoom> :( |
|---|
| 172 | 18:06 < exarkun> We have an example of a different type already - UDP. |
|---|
| 173 | 18:06 < dreid> PenguinOfDoom: that's not how endpoints are supposed to work. |
|---|
| 174 | 18:06 < kenaan> new names defect #3019 by radix: twisted.name's default getHostByName does not reliably fetch records because of its use of ANY (qtype=*) |
|---|
| 175 | 18:06 < glyph> radix: careful with that apostrophe, you might hurt somebody. |
|---|
| 176 | 18:07 < glyph> exarkun: I think I must have a broken mental model of how this is all supposed to work. In my fantasy world, a user cares mostly about the hostname, with IPv6 or IPv4 being an irrelevant detail; connectTCP("hostname", ...) should therefore connect to either v6 or v4 hosts as appropriate and not tell anyone. |
|---|
| 177 | 18:07 < radix> my apostrophes are awesome and deadly. |
|---|
| 178 | 18:07 < glyph> exarkun: once you've done name resolution by yourself, connectTCP(IPv6Address) seems like a good API. |
|---|
| 179 | 18:07 < dreid> I agree. |
|---|
| 180 | 18:07 < exarkun> glyph: HostnameEndpoint("hostname").connectStream(...) |
|---|
| 181 | 18:07 < radix> hmm, ctrl-t doesn't work in firefox |
|---|
| 182 | 18:07 < PenguinOfDoom> glyph: In the real world, google.com gets an A6 record and half their users suddenly can't reach the site because they have a link-local ipv6 address, but no real ipv6 connectivity |
|---|
| 183 | 18:08 < glyph> exarkun: I'm pretty sure I'm confused though. Perhaps that sort of magic should be reserved for something like strports? |
|---|
| 184 | 18:08 < radix> glyph: I changed it |
|---|
| 185 | 18:08 < radix> glyph: I hope you like what I changed it to |
|---|
| 186 | 18:08 < glyph> PenguinOfDoom: I was beginning to guess that might be the case, yes. |
|---|
| 187 | 18:08 < PenguinOfDoom> but wait, there's more. Vista *does* have ipv6 connectivity out of the box |
|---|
| 188 | 18:08 < PenguinOfDoom> so only people behind corporate firewalls will be screwed |
|---|
| 189 | 18:08 < glyph> PenguinOfDoom: ... but it's all routed through spyware.microsoft.com? |
|---|
| 190 | 18:09 < PenguinOfDoom> glyph: No, it uses the magical anycast tunnel, I think |
|---|
| 191 | 18:09 < PenguinOfDoom> not sure how that works with NAT |
|---|
| 192 | 18:09 < therve> oh yeah, XP ipv6 support seems to be totally broken |
|---|
| 193 | 18:09 < radix> PenguinOfDoom: whoah, are you serious? |
|---|
| 194 | 18:09 < exarkun> PenguinOfDoom: It's easy to recognize a link-local ipv6 address and decide to never try to make ipv6 connections. |
|---|
| 195 | 18:10 < exarkun> glyph: Did I answer your question or not? |
|---|
| 196 | 18:10 < PenguinOfDoom> exarkun: Maybe in your fantasy world of well-written C libraries. |
|---|
| 197 | 18:10 < glyph> exarkun: HostnameEndpoint(...)? |
|---|
| 198 | 18:10 < exarkun> glyph: Yes. |
|---|
| 199 | 18:10 < exarkun> PenguinOfDoom: My fantasy world has Python in it, not C. |
|---|
| 200 | 18:10 < PenguinOfDoom> radix: I tried it once, I think. |
|---|
| 201 | 18:10 < radix> PenguinOfDoom: did you connect to freenode? :) |
|---|
| 202 | 18:11 < glyph> exarkun: billions of Twisted programs everywhere are using connectTCP when that's what they mean, but I guess it's not really an important consideration given that we wouldn't be breaking them just by not changing its behavior |
|---|
| 203 | 18:11 < PenguinOfDoom> exarkun: Python can't even find out what local addresses the box has |
|---|
| 204 | 18:11 < PenguinOfDoom> radix: Now that gives me an idea. |
|---|
| 205 | 18:11 < exarkun> glyph: Not changing behavior is awesome. |
|---|
| 206 | 18:12 < PenguinOfDoom> ah crap, this is where amiaaaaornot.net would come in handy |
|---|
| 207 | 18:12 < glyph> exarkun: I would prefer to change behavior so that cool new functionality would magically start working with new versions of Twisted, but I can't really get worked up about this particular feature. IPv6 just makes every particle of my body become sad. |
|---|
| 208 | 18:12 < PenguinOfDoom> I guess, since dreid is being an ass, I should just register the .org or the .com variant |
|---|
| 209 | 18:12 < dreid> PenguinOfDoom: I'm almost certain you already control the DNS. |
|---|
| 210 | 18:12 < exarkun> glyph: Just think about it this way |
|---|
| 211 | 18:13 < exarkun> glyph: There _is_ no cool new functionality. |
|---|
| 212 | 18:13 < PenguinOfDoom> oh whoops |
|---|
| 213 | 18:13 < PenguinOfDoom> dreid: Yes. It's hax time. |
|---|
| 214 | 18:13 < exarkun> glyph: No one cares about or benefits from IPv6. |
|---|
| 215 | 18:13 < glyph> exarkun: Exactly what I meant, yes. :) |
|---|
| 216 | 18:14 < exarkun> Freenode's IPv6 configuration is actually a good example of what the real world constrains you t o. |
|---|
| 217 | 18:14 < exarkun> There is no IPv6 address for chat.freenode.net. |
|---|
| 218 | 18:14 < exarkun> If you want ipv6, then you connect to ipv6.chat.freenode.net. |
|---|
| 219 | 18:14 < glyph> ooh, which ping thinks is an unknown host. |
|---|
| 220 | 18:15 < glyph> is there a ping6? |
|---|
| 221 | 18:15 < PenguinOfDoom> ping6, dude |
|---|
| 222 | 18:15 < glyph> oh god there is |
|---|
| 223 | 18:15 < glyph> fuck |
|---|
| 224 | 18:15 < PenguinOfDoom> hahahaha |
|---|
| 225 | 18:15 < glyph> that was a joke |
|---|
| 226 | 18:15 < exarkun> and traceroute6 and so on and so forth. |
|---|
| 227 | 18:15 < glyph> okay |
|---|
| 228 | 18:15 < PenguinOfDoom> mtr is automagic, though |
|---|
| 229 | 18:15 < PenguinOfDoom> so's telnet |
|---|
| 230 | 18:15 < glyph> well why didn't you guys say so before then |
|---|
| 231 | 18:15 < PenguinOfDoom> -4 or -6 |
|---|
| 232 | 18:15 < glyph> the solution is obvious |
|---|
| 233 | 18:15 < glyph> we'll only have connectTCP |
|---|
| 234 | 18:15 < itamar> twisted6 |
|---|
| 235 | 18:15 < itamar> or connectTCP6? |
|---|
| 236 | 18:15 < glyph> but we'll do sys.argv[0].endswith('6') |
|---|
| 237 | 18:15 < PenguinOfDoom> :/ |
|---|
| 238 | 18:15 < exarkun> alright, we're in joke time now I guess |
|---|
| 239 | 18:16 < glyph> twistd6, trial6, etc |
|---|
| 240 | 18:16 < exarkun> so I'm gonna go get lunch |
|---|