From 4c058689904178714211f38bc5e5e083eaffadbf Mon Sep 17 00:00:00 2001 From: Satoshi Fujii Date: Fri, 15 Oct 2021 05:57:24 +0000 Subject: 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 Issue-ID: DCAEGEN2-2944 Change-Id: Iee682b62a385dfaf2ec1355e781cda9c3def23c0 --- miss_htbt_service/mod/trapd_vnf_table.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'miss_htbt_service/mod/trapd_vnf_table.py') 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' -- cgit 1.2.3-korg