Merge lp:~michael.nelson/charms/trusty/squid-reverseproxy/1454485-set-visible-hostname into lp:charms/trusty/squid-reverseproxy

Proposed by Michael Nelson
Status: Merged
Merged at revision: 55
Proposed branch: lp:~michael.nelson/charms/trusty/squid-reverseproxy/1454485-set-visible-hostname
Merge into: lp:charms/trusty/squid-reverseproxy
Diff against target: 20 lines (+2/-0)
2 files modified
hooks/hooks.py (+1/-0)
templates/main_config.template (+1/-0)
To merge this branch: bzr merge lp:~michael.nelson/charms/trusty/squid-reverseproxy/1454485-set-visible-hostname
Reviewer Review Type Date Requested Status
Tim Van Steenburgh (community) Approve
Review via email: mp+258959@code.launchpad.net

Commit message

Add visible_hostname to avoid excessive DNS queries (bug 1454485)

Description of the change

See bug 1454485 for the details.

Tested locally with a (private) deployment upgrade at:
https://code.launchpad.net/~michael.nelson/canonical-mojo-specs/sca-upgrade-squid-visible-hostname/+merge/258956

Before upgrade:

dev-trusty# ~/charms/squid/trusty/squid-reverseproxy
$ juju run --service sca-cache "head /etc/squid3/squid.conf"
http_port 3128 accel vhost
acl PURGE method PURGE
acl CONNECT method CONNECT
...

After upgrade:
dev-trusty# ~/charms/squid/trusty/squid-reverseproxy
$ juju run --service sca-cache "head /etc/squid3/squid.conf"
visible_hostname michael-local-machine-3
http_port 3128 accel vhost
acl PURGE method PURGE
acl CONNECT method CONNECT
...

Locally I don't have any rDNS issues, but I've manually checked on our staging env to verify that adding the generated visible_hostname does stop the log messages (and from the squid code, the excessive DNS queries).

To post a comment you must log in.
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

+1, LGTM, thanks Michael!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2015-03-25 17:31:27 +0000
3+++ hooks/hooks.py 2015-05-13 04:49:21 +0000
4@@ -257,6 +257,7 @@
5 'refresh_patterns': refresh_patterns,
6 'default_refresh_pattern': default_refresh_pattern,
7 'need_localacl_defs': need_localacl_defs,
8+ 'visible_hostname': get_hostname(),
9 }
10 template = render_template('main_config.template', templ_vars)
11 write_squid3_config('\n'.join(
12
13=== modified file 'templates/main_config.template'
14--- templates/main_config.template 2015-01-20 15:54:55 +0000
15+++ templates/main_config.template 2015-05-13 04:49:21 +0000
16@@ -1,3 +1,4 @@
17+visible_hostname {{ visible_hostname }}
18 http_port {{ config.port }} {{ config.port_options }}
19 {% if config.enable_https -%}
20 https_port {{ config.https_port }} {{ config.https_options }} cert={{ config.ssl_certfile }} key={{ config.ssl_keyfile }}

Subscribers

People subscribed via source and target branches

to all changes: