Repository navigation
Remove the last remnants of the enable_url_expandomatic - #7276
Conversation
|
|
||
| ink_assert(s->dns_info.looking_up == ORIGIN_SERVER); | ||
|
|
||
| TxnDebug("http_trans", "[HttpTransact::OSDNSLookup] This was attempt %d", s->dns_info.attempts); |
There was a problem hiding this comment.
I'm not clear on the DNS_ATTEMPTS_EXHAUSTED and max_dns_lookups removal below.
Do these changes make it impossible for OSDNSLookup to ever be called more than once in a Transaction?
If not, is this debug message useful to people?
Also, I see asserts below, how do we now make sure we don't somehow have a loop?
Also, with the removal of the "expanded name" stuff, why would OSDNSLookup ever need to be called more than once for the same transaction?
There was a problem hiding this comment.
I removed DNS_ATTEMPTS_EXHAUSTED because the current try_to_expand_host_name() never returns that. It only returns EXPANSION_NOT_ALLOWED in the non-parent selection case or RETRY_EXPANDED_NAME in the parent selection case. So got rid of the extra cases and inlined the contents of try_to_expand host name.
With the most of the expandomatic logic gone, only the parent select case exercises this path, and it will only exercise it once to check the IP address of the parent machine rather than the parent path directly (here is where my knowledge of why the parent select logic flips over to OSDNSLookup becomes shakey).
The underlying DNS lookup logic in iocore/DNS will still do multiple DNS requests.
The origin server look up logic will pass through OSDNSLookup multiple times for a transaction if the connection for an IP address fails . Then OSDNSLookup will be triggered again and either the same address is selected again or if it failed too many times, the logic will move onto the next address (assuming DNS returns multiple addresses for the name)
There was a problem hiding this comment.
I was mostly worried about debugging loops. I said transaction, I meant host. It sounds like it shouldn't get called for the same host repeatedly, and if it is, if there is a loop, there should be other debug messages. Besides which, I think parent selection is the right place to log "this is lookup N," not here.
rob05c
left a comment
There was a problem hiding this comment.
LGTM. Removing an incomplete feature, the only functional change I see is the attempts debug message, and IMO that's better done in the parent selection code
| ink_assert(s->dns_info.looking_up == PARENT_PROXY); | ||
|
|
||
| s->dns_info.lookup_name = s->server_info.name; | ||
| s->dns_info.looking_up = ORIGIN_SERVER; |
There was a problem hiding this comment.
Oh, there is a functional change here: if the parent DNS lookup failed, we used to covertly get and return the Origin IP, when the Parent Selection asked for the Parent? Wat? That seems always wrong.
My Approval stands: if this was happening, I think it was wrong. Returning an IP for a host Parent Selection didn't ask for sounds like it would cause all kinds of confusion and unexpected behavior. If we need to fail to the Origin, Parent Selection (/Nexthop/Strategies) needs to decide that, not the DNS lookup subversively returning an IP for a host we didn't ask for.
Can someone else confirm that? @jrushford
There was a problem hiding this comment.
@rob05c and @shinrich I'm not familiar with this expandomatic feature but yeah, this seems like it was wrong to switch over to the origin. If it could not expand the parent name, the state machine should ask parent selection for a new available parent to try instead of switching over to the origin. I think a switch to the origin should occur only when the parent list is exhausted.
commented
Nov 6, 2020
|
@shinrich the crash shown here is not related to this PR, I see it on master as well |
left a comment
There was a problem hiding this comment.
@shinrich I built and tested this and looked it over. It looks good to me.
| ink_assert(s->dns_info.looking_up == PARENT_PROXY); | ||
|
|
||
| s->dns_info.lookup_name = s->server_info.name; | ||
| s->dns_info.looking_up = ORIGIN_SERVER; |
There was a problem hiding this comment.
@rob05c and @shinrich I'm not familiar with this expandomatic feature but yeah, this seems like it was wrong to switch over to the origin. If it could not expand the parent name, the state machine should ask parent selection for a new available parent to try instead of switching over to the origin. I think a switch to the origin should occur only when the parent list is exhausted.
Ran into this while working through the outbound connection logic. The comments and logic around try_to_expand_host_name seemed odd, and I didn't see any relevant configuration. I found some old 4.1.x documentation stashed on the internet which pointed me to proxy.config.http.enable_url_expandomatic, and from there got to @reveller's PR #918 which removed the configuration for this feature. Cool name, but confusing feature.
This PR removes the last confusing implementation remnants of this feature. I may have gone a bit too far in the parent selection case (the only case that did anything in the try_to_expand_host_name method), so I would appreciate some eyes on from parent selection experts like @rob05c, @ezelkow1 and @randall.
From within HttpTransact::OSDNSLookup, I inlined the remaining logic of try_to_expand_host_name, which is to always fail if is not a parent lookup. Then I remembered that there is a parallel parent version of this method, HttpTransact::PPDNSLookup, so I removed the retry logic entirely. There was a static max_dns_lookups = 3 within the OSDNSLookup method, and the dns_info has an attempts member. I removed both of those on the assumption that the parent selection does not go through OSDNSLookup, so it will not trigger the logic to do a DNS lookup on the hostname instead of the parent name. If this functionality is indeed used, I will add it back.
In terms of DNS retries, that is handled at the DNS level and controlled by the config proxy.config.dns.retries.
If we are not changing the name and re-issuing the DNS request, we can also get rid of the logic that returns a redirect if the name change lookup succeeded.