Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-1073

no_dns_just_forward_to_parent configuration parameter is ignored/not used.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.2
    • 3.1.2
    • DNS
    • None
    • Ubuntu 10.0, Fedora 14

    Description

      I have two instances of trafficserver configured, one instance is configured to use the second instance as a parent proxy using the following parameters from the records.config:

      CONFIG proxy.config.http.no_dns_just_forward_to_parent INT 1

      CONFIG proxy.config.http.parent_proxy_routing_enable INT 1

      The parent config looks like this:
      dest_domain=. parent="parent:8080" round_robin=false

      The no_dns_just_forward_to_parent is not used in the code and as a result dns lookups are being performed in the child instance.

      The following code changes seem to fix this:

      proxy/http/HttpSM.cc
      @@ -6406,11 +6405,20 @@
      t_state.dns_info.lookup_success = true;
      call_transact_and_set_next_state(NULL);
      break;
      } else if (t_state.parent_result.r == PARENT_UNDEFINED && t_state.dns_info.lookup_success)

      { // Already set, and we don't have a parent proxy to lookup ink_assert(t_state.host_db_info.ip()); Debug("dns", "[HttpTransact::HandleRequest] Skipping DNS lookup, provided by plugin"); call_transact_and_set_next_state(NULL); break; + }

      else if (t_state.dns_info.looking_up == HttpTransact::ORIGIN_SERVER &&
      + t_state.http_config_param->no_dns_forward_to_parent){
      +
      + if(t_state.cop_test_page)

      { + t_state.host_db_info.ip() =t_state.state_machine->ua_session->get_netvc()->get_local_ip(); + }

      +
      + t_state.dns_info.lookup_success = true;
      + call_transact_and_set_next_state(NULL);
      + break;
      }

      HTTP_SM_SET_DEFAULT_HANDLER(&HttpSM::state_hostdb_lookup);

      to avoid reverse ns lookups
      /proxy/http/HttpTransact.cc
      @@ -1650,7 +1651,8 @@
      } else if (s->dns_info.lookup_name[0] <= '9' &&
      s->dns_info.lookup_name[0] >= '0' &&
      //(s->state_machine->authAdapter.needs_rev_dns() ||

      • ( host_rule_in_CacheControlTable() || s->parent_params->ParentTable->hostMatch)) {
        + ( host_rule_in_CacheControlTable() || s->parent_params->ParentTable->hostMatch) &&
        + !s->http_config_param->no_dns_forward_to_parent) {
        // note, broken logic: ACC fudges the OR stmt to always be true,
        // 'AuthHttpAdapter' should do the rev-dns if needed, not here .
        TRANSACT_RETURN(REVERSE_DNS_LOOKUP, HttpTransact::StartAccessControl);

      I would like to have these changes applied to the repository if they look ok.

      I also created an empty resolv.conf and pointed ats to the empty file:
      CONFIG proxy.config.dns.resolv_conf STRING /usr/local/etc/trafficserver/resolv.conf

      When these changes are applied the child instance no longer attempts to perform dns lookups for the
      http requests that it receives. If they are not applied and the dns lookup it slow or unreliable on the
      child then the http requests are blocked by the dns lookup within the child trafficserver instance.

      Attachments

        1. TS-1073.patch
          2 kB
          Kevin Giles

        Activity

          People

            zwoop Leif Hedstrom
            kevin01 Kevin Giles
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: