You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Brian Geffon (JIRA)" <ji...@apache.org> on 2015/07/17 08:05:04 UTC

[jira] [Commented] (TS-3774) Bug in HostDB hosts file implementation

    [ https://issues.apache.org/jira/browse/TS-3774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14630827#comment-14630827 ] 

Brian Geffon commented on TS-3774:
----------------------------------

[~amc] I assigned this to you, I've attached a patch that will resolve the problem. The only issue with this implementation is that it will leak HostDBInfo structures anytime you remove an entry from the hostsfile. As you can see in this implementation it would reallocate existing items on reload so it's fairly efficient in that regard.

[~jacksontj] I added you as a watcher too.

> Bug in HostDB hosts file implementation
> ---------------------------------------
>
>                 Key: TS-3774
>                 URL: https://issues.apache.org/jira/browse/TS-3774
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: HostDB
>            Reporter: Brian Geffon
>            Assignee: Alan M. Carroll
>         Attachments: ts-3774.patch
>
>
> There is a bug in the current implementation of hostdb's use of hostsfiles. Because it uses a static local variable the storage is shared and ultimately will lead to race conditions if the hosts file is reloaded.
> {code}
> if (find_result != current_host_file_map->hosts_file_map.end()) {
>     // TODO: Something to make this not local :/
>     static HostDBInfo r;
>     r.round_robin = false;
>     r.round_robin_elt = false;
>     r.reverse_dns = false;
>     r.is_srv = false;
>     ats_ip_set(r.ip(), (*find_result).second);
>     return &r;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)