synchronize file update in sysinv agent

This modification adds a synchronization decorator to the
file update function of the sysinv agent.
This will ensure that the operation does not happen
concurrently with the 'runtime manifest apply' or the
'agent audit' function.
Otherwise, a race condition may happen and cause
manifest corruption or failure to properly handle alarms.

Closes-Bug: #1791969

Change-Id: If9b6baf1608850bad0e3830ebe8345f7dc68ef62
Signed-off-by: Paul-Emile Element <Paul-Emile.Element@windriver.com>
This commit is contained in:
Paul-Emile Element 2018-09-11 11:28:25 -04:00
parent bb08393749
commit 5998f072ea
1 changed files with 1 additions and 0 deletions

View File

@ -1292,6 +1292,7 @@ class AgentManager(service.PeriodicService):
return
@utils.synchronized(LOCK_AGENT_ACTION, external=False)
def iconfig_update_file(self, context, iconfig_uuid, iconfig_dict):
"""Configure the iiconfig_uuid, by updating file based upon
iconfig_dict.