Merge lp:~thedac/charm-helpers/lp1522130 into lp:charm-helpers

Proposed by David Ames
Status: Merged
Merged at revision: 500
Proposed branch: lp:~thedac/charm-helpers/lp1522130
Merge into: lp:charm-helpers
Diff against target: 56 lines (+22/-9)
2 files modified
charmhelpers/contrib/openstack/context.py (+6/-0)
charmhelpers/contrib/openstack/templates/haproxy.cfg (+16/-9)
To merge this branch: bzr merge lp:~thedac/charm-helpers/lp1522130
Reviewer Review Type Date Requested Status
James Page Approve
David Ames (community) Needs Resubmitting
Review via email: mp+279519@code.launchpad.net

Description of the change

Fix bug #1522130

Add sane defaults for timeout connect and queue and make them configurable.

To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

I think this needs a fix for the HAproxy context, equivalent to the following:

        if config('haproxy-server-timeout'):
            ctxt['haproxy_server_timeout'] = config('haproxy-server-timeout')

        if config('haproxy-client-timeout'):
            ctxt['haproxy_client_timeout'] = config('haproxy-client-timeout')

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

Could I also request that the whitespace slurping be fixed in the template:

defaults
    log global
    mode tcp
    option tcplog
    option dontlognull
    retries 3
    timeout queue 9000
    timeout connect 9000
timeout client 30000
timeout server 30000
listen stats :8888

This is what currently gets generated.

Revision history for this message
David Ames (thedac) wrote :

Added missing context bits for queue and connect timeouts.

Fixed up the whitespace problems in the template.

review: Needs Resubmitting
Revision history for this message
James Page (james-page) wrote :

David

Not sure why but your second commit drops a whole load of other stuff from the context module?

review: Needs Fixing
lp:~thedac/charm-helpers/lp1522130 updated
495. By David Ames

Add haproxy context for new timeout values. Fix template whitespace

Revision history for this message
David Ames (thedac) wrote :

Ah, this is correct in the charms themselves. Fixed in CH.

review: Needs Resubmitting
Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/context.py'
2--- charmhelpers/contrib/openstack/context.py 2015-11-19 17:33:29 +0000
3+++ charmhelpers/contrib/openstack/context.py 2015-12-08 15:59:11 +0000
4@@ -626,6 +626,12 @@
5 if config('haproxy-client-timeout'):
6 ctxt['haproxy_client_timeout'] = config('haproxy-client-timeout')
7
8+ if config('haproxy-queue-timeout'):
9+ ctxt['haproxy_queue_timeout'] = config('haproxy-queue-timeout')
10+
11+ if config('haproxy-connect-timeout'):
12+ ctxt['haproxy_connect_timeout'] = config('haproxy-connect-timeout')
13+
14 if config('prefer-ipv6'):
15 ctxt['ipv6'] = True
16 ctxt['local_host'] = 'ip6-localhost'
17
18=== modified file 'charmhelpers/contrib/openstack/templates/haproxy.cfg'
19--- charmhelpers/contrib/openstack/templates/haproxy.cfg 2015-01-13 11:20:23 +0000
20+++ charmhelpers/contrib/openstack/templates/haproxy.cfg 2015-12-08 15:59:11 +0000
21@@ -12,19 +12,26 @@
22 option tcplog
23 option dontlognull
24 retries 3
25- timeout queue 1000
26- timeout connect 1000
27-{% if haproxy_client_timeout -%}
28+{%- if haproxy_queue_timeout %}
29+ timeout queue {{ haproxy_queue_timeout }}
30+{%- else %}
31+ timeout queue 5000
32+{%- endif %}
33+{%- if haproxy_connect_timeout %}
34+ timeout connect {{ haproxy_connect_timeout }}
35+{%- else %}
36+ timeout connect 5000
37+{%- endif %}
38+{%- if haproxy_client_timeout %}
39 timeout client {{ haproxy_client_timeout }}
40-{% else -%}
41+{%- else %}
42 timeout client 30000
43-{% endif -%}
44-
45-{% if haproxy_server_timeout -%}
46+{%- endif %}
47+{%- if haproxy_server_timeout %}
48 timeout server {{ haproxy_server_timeout }}
49-{% else -%}
50+{%- else %}
51 timeout server 30000
52-{% endif -%}
53+{%- endif %}
54
55 listen stats {{ stat_port }}
56 mode http

Subscribers

People subscribed via source and target branches