fix race with syslog while renaming remote log dir
When a node gets new name nailgun renames log directory which had name
in form of <IP> to <node name> and then creates symlink <IP> ->
<node name>. The problem is that node is still active at this moment
and sends some logs to syslog on master node. So when we renamed <IP>
to <node name> and haven't created symlink name syslog may find
missing log dir and it creates it again in this case. Then nailgun
tries to create symlink and fails.
To avoid this situation this patch adds attempts to remove a directory
and create symlink until symlink will being successfully created.
Approach used in master does not work in <=8.0. In MOS=<8.0 nailgun
and rsyslog work in different PID namespaces and can not interact
with each other by signals.
Reviewed: https:/ /review. openstack. org/332001 /git.openstack. org/cgit/ openstack/ fuel-web/ commit/ ?id=11ce99ab4e4 6fad061edd99c63 42ea647f0acd75
Committed: https:/
Submitter: Jenkins
Branch: stable/8.0
commit 11ce99ab4e46fad 061edd99c6342ea 647f0acd75
Author: Rodion Tikunov <email address hidden>
Date: Mon Jun 20 18:48:12 2016 +0300
fix race with syslog while renaming remote log dir
When a node gets new name nailgun renames log directory which had name
in form of <IP> to <node name> and then creates symlink <IP> ->
<node name>. The problem is that node is still active at this moment
and sends some logs to syslog on master node. So when we renamed <IP>
to <node name> and haven't created symlink name syslog may find
missing log dir and it creates it again in this case. Then nailgun
tries to create symlink and fails.
To avoid this situation this patch adds attempts to remove a directory
and create symlink until symlink will being successfully created.
Approach used in master does not work in <=8.0. In MOS=<8.0 nailgun
and rsyslog work in different PID namespaces and can not interact
with each other by signals.
Change-Id: Ia402508dac4279 09aa1593787f9ab a54f2df05e4
Closes-bug: #1506112