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 <email address hidden>
Reviewed: https:/ /review. openstack. org/649713 /git.openstack. org/cgit/ openstack/ stx-fault/ commit/ ?id=7ae75e24c8c 425bb1b2741a55d 203c5069072990
Committed: https:/
Submitter: Zuul
Branch: master
commit 7ae75e24c8c425b b1b2741a55d203c 5069072990
Author: Eric MacDonald <email address hidden>
Date: Wed Apr 3 15:50:41 2019 -0400
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: I3d5ef0bd9cb774 299b4c0f3b9e33c ddb7c0f776c
Signed-off-by: Eric MacDonald <email address hidden>