diff options
author | Satoshi Fujii <fujii-satoshi@jp.fujitsu.com> | 2021-10-15 05:57:24 +0000 |
---|---|---|
committer | Satoshi Fujii <fujii-satoshi@jp.fujitsu.com> | 2021-10-21 09:48:00 +0000 |
commit | 4c058689904178714211f38bc5e5e083eaffadbf (patch) | |
tree | bbb11bbbfb212baa26a05a3d02491b04eb8889f0 /miss_htbt_service/mod/trapd_vnf_table.py | |
parent | 8ea70b60efac67f8b4ad4be8b8018a946f551d06 (diff) |
Fix cbs polling process startup failure
cbs polling process sometimes failed to start by `relation
"hb_common" does not exist` error.
The polling process tries to read hb_common table on startup,
but the process is created before the parent process creates
hb_common table. So the error may occur in race condition.
cbs_polling process must be started after `hb_common` table populated.
Signed-off-by: Satoshi Fujii <fujii-satoshi@jp.fujitsu.com>
Issue-ID: DCAEGEN2-2944
Change-Id: Iee682b62a385dfaf2ec1355e781cda9c3def23c0
Diffstat (limited to 'miss_htbt_service/mod/trapd_vnf_table.py')
-rw-r--r-- | miss_htbt_service/mod/trapd_vnf_table.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/miss_htbt_service/mod/trapd_vnf_table.py b/miss_htbt_service/mod/trapd_vnf_table.py index ffef262..ff738f0 100644 --- a/miss_htbt_service/mod/trapd_vnf_table.py +++ b/miss_htbt_service/mod/trapd_vnf_table.py @@ -91,14 +91,10 @@ def verify_DB_creation_hb_common(user_name,password,ip_address,port_num,db_name) def verify_cbspolling(): os.environ['pytest']='test' os.environ['SERVICE_NAME']='mvp-dcaegen2-heartbeat-static' - try: - _cbspolling=cbs.pollCBS(10) - except Exception as e: - return None - + cbs.poll_cbs(10) os.unsetenv('pytest') os.unsetenv('SERVICE_NAME') - return _cbspolling + def verify_fetch_json_file(): os.environ['pytest']='test' |