Resolve amphora agent read timeout issue

Occasionally the test jobs[1] will fail with:
octavia.amphorae.drivers.haproxy.rest_api_driver [-]
Could not connect to instance. Read timed out. (read timeout=120.0)

This patch increases the default read timeout to 180 and changes the
directory copy that would subsequently fail to be more idempotent.

[1] http://logs.openstack.org/09/613709/14/check/ \
octavia-v2-dsvm-scenario-two-node/d83db12/controller2/logs/ \
screen-o-cw.txt.gz#_Feb_08_21_58_23_919928

Change-Id: Ia0bd6762c2605ce240a549b3e90e5c44b65897a5
This commit is contained in:
Michael Johnson 2019-02-08 16:03:56 -08:00
parent d21c99fba9
commit 0f0aa02161
4 changed files with 13 additions and 13 deletions

View File

@ -317,7 +317,7 @@
# agent_server_network_dir =
# agent_server_network_file =
# agent_request_read_timeout = 120
# agent_request_read_timeout = 180
# Amphora default UDP driver is keepalived_lvs
#

View File

@ -81,19 +81,19 @@ class BaseOS(object):
# interfaces and scripts.
try:
os.makedirs('/etc/netns/' + consts.AMPHORA_NAMESPACE)
shutil.copytree(
network_dir,
'/etc/netns/{netns}/{net_dir}'.format(
netns=consts.AMPHORA_NAMESPACE,
net_dir=netns_network_dir),
symlinks=True,
ignore=ignore)
except OSError as e:
# Raise the error if it's not "File exists" otherwise pass
if e.errno != errno.EEXIST:
raise
shutil.copytree(
network_dir,
'/etc/netns/{netns}/{net_dir}'.format(
netns=consts.AMPHORA_NAMESPACE,
net_dir=netns_network_dir),
symlinks=True,
ignore=ignore)
def write_vip_interface_file(self, interface_file_path,
primary_interface, vip, ip, broadcast,
netmask, gateway, mtu, vrrp_ip, vrrp_version,

View File

@ -111,7 +111,7 @@ amphora_agent_opts = [
help=_("The file where the network interfaces are located. "
"Specifying this will override any value set for "
"agent_server_network_dir.")),
cfg.IntOpt('agent_request_read_timeout', default=120,
cfg.IntOpt('agent_request_read_timeout', default=180,
help=_("The time in seconds to allow a request from the "
"controller to run before terminating the socket.")),
# Do not specify in octavia.conf, loaded at runtime

View File

@ -79,7 +79,7 @@ class AgentJinjaTestCase(base.TestCase):
'/etc/octavia/certs/server.pem\n'
'agent_server_network_dir = '
'/etc/network/interfaces.d/\n'
'agent_request_read_timeout = 120\n'
'agent_request_read_timeout = 180\n'
'amphora_id = ' + AMP_ID + '\n'
'amphora_udp_driver = keepalived_lvs\n\n'
'[controller_worker]\n'
@ -117,7 +117,7 @@ class AgentJinjaTestCase(base.TestCase):
'/etc/network/interfaces.d/\n'
'agent_server_network_file = '
'/etc/network/interfaces\n'
'agent_request_read_timeout = 120\n'
'agent_request_read_timeout = 180\n'
'amphora_id = ' + AMP_ID + '\n'
'amphora_udp_driver = keepalived_lvs\n\n'
'[controller_worker]\n'
@ -155,7 +155,7 @@ class AgentJinjaTestCase(base.TestCase):
'/etc/octavia/certs/server.pem\n'
'agent_server_network_dir = '
'/etc/network/interfaces.d/\n'
'agent_request_read_timeout = 120\n'
'agent_request_read_timeout = 180\n'
'amphora_id = ' + AMP_ID + '\n'
'amphora_udp_driver = new_udp_driver\n\n'
'[controller_worker]\n'