Uploaded image for project: 'Traffic Control'
  1. Traffic Control
  2. TC-118

Traffic Ops should get it's name from some confioguration when generating CrConfig

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.1.0, 2.0.0, 1.8.0, 1.7.0, 2.2.0
    • 2.2.0
    • Traffic Ops

    Description

      The code that generates the CrConfig has a problem when creating the "stat" section.
      It fills values for that section, such as "tm_host", based on the HTTP headers found in the request that triggered the CrConfig snapshot:

      Here is a snippet from traffic_ops/app/lib/UI/Topology.pm:

      $data_obj->

      {'stats'}>{'tm_path'} = $self>req->url->path->{'path'};
      $data_obj->{'stats'}

      ->

      {'tm_host'}

      = $self->req->headers->host;

      I find this to be a problem for two reasons:

      This code assumes that it is being run from the context of an HTTP transaction, which to me sounds like contaminating the logic of actually creating the CrConfig with details from the upper layer which currently uses this logic.
      For example, if one would want to run this code from a different path (Maybe in a unit test), it would be a problem.

      If the traffic ops is accessed through a NAT, then the host name known to the HTTP client issuing the 'Snapshot CrConfig' request is not necessarily the same as the traffic ops host name known to the other components of the system, e.g. the traffic router that uses this information.

      (This is how I found out about this problem - we are experimenting with deploying TC in the cloud (Amazon EC2) and the host name visible to the outside world is not the same as the host names used internally)

      I believe that tm_host should come from the database (Currently there is no entry from the traffic ops itself, but such an entry can be created for this purpose), or from cdn.conf.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shemesh Oren Shemesh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: