From 76ab93fa353ff110c706982eb1f13a9166517ed0 Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Wed, 24 May 2023 10:24:49 +0200 Subject: [PATCH] Allow clustercheck to wait before finishing Under rare circumstances of heavy loaded environments, HAProxy may report 'socket error' when disconnecting from clustercheck if the latter closed its side of the connection first. Add a configurable post status wait time in clustercheck to fix HAProxy error reporting. By default, this post wait is not used. Change-Id: I07bf928742f5ff579070f4d1d6248d5b105bce55 Related-Bug: #2020490 --- manifests/profile/pacemaker/clustercheck.pp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/manifests/profile/pacemaker/clustercheck.pp b/manifests/profile/pacemaker/clustercheck.pp index 50584c5d7..734ba0e62 100644 --- a/manifests/profile/pacemaker/clustercheck.pp +++ b/manifests/profile/pacemaker/clustercheck.pp @@ -34,12 +34,20 @@ # (Optional) The password for the clustercheck user. # Defaults to lookup('mysql_clustercheck_password') # +# [*post_status_wait*] +# (Optional) Number of seconds to wait after status is returned. +# This is only useful for slow environments where haproxy may report +# a "socket error" after clustercheck status is returned if it cannot +# poll and close its side of the connection before socat does. +# Defaults to 0 +# # class tripleo::profile::pacemaker::clustercheck ( $step = Integer(lookup('step')), $clustercheck_user = 'clustercheck', $clustercheck_password = lookup('mysql_clustercheck_password'), $bind_address = lookup('mysql_bind_host'), + $post_status_wait = 0, ) { if $step >= 1 { @@ -59,7 +67,8 @@ class tripleo::profile::pacemaker::clustercheck ( content => "MYSQL_USERNAME=${clustercheck_user}\n MYSQL_PASSWORD='${clustercheck_password}'\n MYSQL_HOST=localhost\n -TRIPLEO_SOCAT_BIND='${socat_listen_type}:9200,bind=\"${bind_address}\",reuseaddr,fork'\n", +TRIPLEO_SOCAT_BIND='${socat_listen_type}:9200,bind=\"${bind_address}\",reuseaddr,fork'\n +TRIPLEO_POST_STATUS_WAIT=${post_status_wait}\n", } # configuration used when clustercheck is run via xinet