fault/fm-api
Eric MacDonald 7ae75e24c8 Protect FM API shared data with thread locking
Collectd runs all its python plugins concurrently.

With the expansion of collectd python plugins due
to the obsolesence of rmon collectd core dumps are
being reported during collectd startup when the FM
service on the controller is not running.

Debug of the issue revealed that the core dumps are
due to having no mutex around FM API's shared data.

The required mutex is provided by this update by
adding a while locked expression to the start of
each API.

Also fixed 3 pep8 errors.

Closes-Bug: 1819473

Test Plan:
PASS: Test before and after cases to confirm that without
      the change we see core dumps but with the change the
      API and collectd plugin behavior is correct without
      the core dumps.
PASS: System install with current collectd plugins and fm's
      python API enhanced with locking.
PASS: Have sm stop managing the fmManager process, kill it
      and then restart collectd over and over.
      Should not see any collectd core dumps.
PASS: Verify nfv alarming still works

Change-Id: I3d5ef0bd9cb774299b4c0f3b9e33cddb7c0f776c
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
2019-04-09 20:32:26 +00:00
..
centos Implement FaultAPIsV2 to distinguish fail and no data case 2019-03-05 20:14:49 +08:00
fm_api Protect FM API shared data with thread locking 2019-04-09 20:32:26 +00:00
.gitignore StarlingX open source release updates 2018-05-31 07:36:00 -07:00
LICENSE StarlingX open source release updates 2018-05-31 07:36:00 -07:00
PKG-INFO StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fm_api_test.py Implement FaultAPIsV2 to distinguish fail and no data case 2019-03-05 20:14:49 +08:00
fm_api_v2_test.py Fix clear_fault/clear_all in FaultAPIsV2 raise exception when alarm is 2019-04-01 01:31:49 +08:00
setup.py StarlingX open source release updates 2018-05-31 07:36:00 -07:00