Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Draining for TCP and PROXY #736

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions jobs/haproxy/templates/drain.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ haproxy_master_pid=$(pgrep -P "$pid" -x haproxy)

<%- if p("ha_proxy.enable_health_check_http") -%>
echo "disable frontend health_check_http_url" | /usr/local/bin/socat stdio unix-connect:${sockfile}
<%- if p("ha_proxy.expect_proxy_cidrs", []).size > 0 -%>
echo "disable frontend health_check_http_url_proxy_protocol" | /usr/local/bin/socat stdio unix-connect:${sockfile}
<%- end -%>
<%- tcp.each do |tcp_proxy| -%>
<%- if tcp_proxy["health_check_http"] -%>
echo "disable frontend health_check_http_tcp-<%= tcp_proxy["name"] %>" | /usr/local/bin/socat stdio unix-connect:${sockfile}
<%- end -%>
<%- end -%>
echo "$(date): triggering grace period for process ${haproxy_master_pid}" >> ${logfile}
sleep <%= p("ha_proxy.drain_frontend_grace_time") %>
<%- end -%>
Expand Down