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
=== modified file 'charmhelpers/contrib/openstack/context.py'
--- charmhelpers/contrib/openstack/context.py 2015-11-19 17:33:29 +0000
+++ charmhelpers/contrib/openstack/context.py 2015-12-08 15:59:11 +0000
@@ -626,6 +626,12 @@
626 if config('haproxy-client-timeout'):626 if config('haproxy-client-timeout'):
627 ctxt['haproxy_client_timeout'] = config('haproxy-client-timeout')627 ctxt['haproxy_client_timeout'] = config('haproxy-client-timeout')
628628
629 if config('haproxy-queue-timeout'):
630 ctxt['haproxy_queue_timeout'] = config('haproxy-queue-timeout')
631
632 if config('haproxy-connect-timeout'):
633 ctxt['haproxy_connect_timeout'] = config('haproxy-connect-timeout')
634
629 if config('prefer-ipv6'):635 if config('prefer-ipv6'):
630 ctxt['ipv6'] = True636 ctxt['ipv6'] = True
631 ctxt['local_host'] = 'ip6-localhost'637 ctxt['local_host'] = 'ip6-localhost'
632638
=== modified file 'charmhelpers/contrib/openstack/templates/haproxy.cfg'
--- charmhelpers/contrib/openstack/templates/haproxy.cfg 2015-01-13 11:20:23 +0000
+++ charmhelpers/contrib/openstack/templates/haproxy.cfg 2015-12-08 15:59:11 +0000
@@ -12,19 +12,26 @@
12 option tcplog12 option tcplog
13 option dontlognull13 option dontlognull
14 retries 314 retries 3
15 timeout queue 100015{%- if haproxy_queue_timeout %}
16 timeout connect 100016 timeout queue {{ haproxy_queue_timeout }}
17{% if haproxy_client_timeout -%}17{%- else %}
18 timeout queue 5000
19{%- endif %}
20{%- if haproxy_connect_timeout %}
21 timeout connect {{ haproxy_connect_timeout }}
22{%- else %}
23 timeout connect 5000
24{%- endif %}
25{%- if haproxy_client_timeout %}
18 timeout client {{ haproxy_client_timeout }}26 timeout client {{ haproxy_client_timeout }}
19{% else -%}27{%- else %}
20 timeout client 3000028 timeout client 30000
21{% endif -%}29{%- endif %}
2230{%- if haproxy_server_timeout %}
23{% if haproxy_server_timeout -%}
24 timeout server {{ haproxy_server_timeout }}31 timeout server {{ haproxy_server_timeout }}
25{% else -%}32{%- else %}
26 timeout server 3000033 timeout server 30000
27{% endif -%}34{%- endif %}
2835
29listen stats {{ stat_port }}36listen stats {{ stat_port }}
30 mode http37 mode http

Subscribers

People subscribed via source and target branches