File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,6 +109,20 @@ if [ $(id -u) != 0 ]; then
109109 $SUDO service sshd restart
110110fi
111111
112+ # Sometimes keystone admin port is used as ephemeral port for other connections and gate jobs fail with httpd error 'Address already in use'.
113+ # We reserve port 35357 at the beginning of the job execution to mitigate this issue as much as possible.
114+ # Similar hack is done in devstack https://github.com/openstack-dev/devstack/blob/master/tools/fixup_stuff.sh#L53-L68
115+
116+ # Get any currently reserved ports, strip off leading whitespace
117+ keystone_port=35357
118+ reserved_ports=$( sysctl net.ipv4.ip_local_reserved_ports | awk -F' =' ' {print $2;}' | sed ' s/^ //' )
119+
120+ if [[ -z " ${reserved_ports} " ]]; then
121+ $SUDO sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_port}
122+ else
123+ $SUDO sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_port} ,${reserved_ports}
124+ fi
125+
112126# TODO: REMOVE ME
113127# https://github.com/openstack/diskimage-builder/blob/b5bcb3b60ec33c4538baa1aeacd026998b155ca6/elements/yum-minimal/pre-install.d/03-yum-cleanup#L26
114128$SUDO yum -y reinstall glibc-common
You can’t perform that action at this time.
0 commit comments