summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler
diff options
context:
space:
mode:
authorefiacor <fiachra.corcoran@est.tech>2020-10-28 14:56:46 +0000
committerefiacor <fiachra.corcoran@est.tech>2020-11-18 09:49:09 +0000
commit062c4a7c72a1b45bc2e37a04b469321c5abc9d97 (patch)
tree6444859a7e02c1cae68c308b03f523f85861187a /components/pm-subscription-handler
parent006ab23bc2863627571ea7a065de7b05e78b21f6 (diff)
[PMSH] Fix thread crash edge case
Signed-off-by: efiacor <fiachra.corcoran@est.tech> Change-Id: Iebfa05ebc78531191159adf5229ab39082dd1d58 Issue-ID: DCAEGEN2-2501
Diffstat (limited to 'components/pm-subscription-handler')
-rwxr-xr-xcomponents/pm-subscription-handler/Changelog.md5
-rwxr-xr-xcomponents/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py9
-rw-r--r--components/pm-subscription-handler/pom.xml2
-rw-r--r--components/pm-subscription-handler/setup.py2
-rw-r--r--components/pm-subscription-handler/version.properties4
5 files changed, 14 insertions, 8 deletions
diff --git a/components/pm-subscription-handler/Changelog.md b/components/pm-subscription-handler/Changelog.md
index 6e7e0428..09afe1c5 100755
--- a/components/pm-subscription-handler/Changelog.md
+++ b/components/pm-subscription-handler/Changelog.md
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+
+## [1.2.0]
+### Changed
+* Bug fix prevent sub threads from crashing permanently (DCAEGEN2-2501)
+
## [1.1.2]
### Changed
* Bug fix for missing sdnc params in DELETE event (DCAEGEN2-2483)
diff --git a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
index 24eade98..c6be38d0 100755
--- a/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
+++ b/components/pm-subscription-handler/pmsh_service/mod/pmsh_utils.py
@@ -114,13 +114,11 @@ class AppConfig:
"""
try:
app_conf = self._get_pmsh_config()
- if "INVALID JSON" in app_conf.values():
- raise ValueError('Failed to refresh AppConfig: INVALID JSON')
self.subscription.administrativeState = app_conf['policy']['subscription'][
'administrativeState']
logger.info("AppConfig data has been refreshed")
except ValueError or Exception as e:
- logger.error(e)
+ logger.error(f'Failed to refresh AppConfig: {e}', exc_info=True)
def get_mr_sub(self, sub_name):
"""
@@ -287,4 +285,7 @@ class PeriodicTask(Timer):
def run(self):
self.function(*self.args, **self.kwargs)
while not self.finished.wait(self.interval):
- self.function(*self.args, **self.kwargs)
+ try:
+ self.function(*self.args, **self.kwargs)
+ except Exception as e:
+ logger.error(f'Exception in thread: {self.name}: {e}', exc_info=True)
diff --git a/components/pm-subscription-handler/pom.xml b/components/pm-subscription-handler/pom.xml
index b28c6737..fa341a3d 100644
--- a/components/pm-subscription-handler/pom.xml
+++ b/components/pm-subscription-handler/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.onap.dcaegen2.services</groupId>
<artifactId>pmsh</artifactId>
<name>dcaegen2-services-pm-subscription-handler</name>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.sources>.</sonar.sources>
diff --git a/components/pm-subscription-handler/setup.py b/components/pm-subscription-handler/setup.py
index c16323ea..65a07703 100644
--- a/components/pm-subscription-handler/setup.py
+++ b/components/pm-subscription-handler/setup.py
@@ -21,7 +21,7 @@ from setuptools import setup, find_packages
setup(
name="pm_subscription_handler",
- version="1.1.1",
+ version="1.2.0",
packages=find_packages(),
author="lego@est.tech",
author_email="lego@est.tech",
diff --git a/components/pm-subscription-handler/version.properties b/components/pm-subscription-handler/version.properties
index e6eb586c..00ef5645 100644
--- a/components/pm-subscription-handler/version.properties
+++ b/components/pm-subscription-handler/version.properties
@@ -1,6 +1,6 @@
major=1
-minor=1
-patch=2
+minor=2
+patch=0
base_version=${major}.${minor}.${patch}
release_version=${base_version}
snapshot_version=${base_version}-SNAPSHOT