Resolved Bug 1684 - MON fails to collect metrics from an OpenStack VIM with metrics... 44/11244/3
authorAtul Agarwal <Atul.Agarwal@Altran.com>
Fri, 8 Oct 2021 05:18:27 +0000 (05:18 +0000)
committerAtul Agarwal <atul.agarwal@altran.com>
Tue, 12 Oct 2021 07:45:41 +0000 (07:45 +0000)
Change-Id: Ia8f01237d570a3f12529c3fd33ccc5771308f49e
Signed-off-by: Atul Agarwal <Atul.Agarwal@Altran.com>
osm_mon/collector/service.py

index aa27083..005f844 100644 (file)
@@ -27,6 +27,7 @@ import logging
 from typing import List
 import concurrent.futures
 import time
+import keystoneauth1.exceptions
 
 from osm_mon.collector.infra_collectors.onos import OnosInfraCollector
 from osm_mon.collector.infra_collectors.openstack import OpenstackInfraCollector
@@ -202,13 +203,17 @@ class CollectorService:
                 for future in concurrent.futures.as_completed(
                     futures, self.conf.get("collector", "process_execution_timeout")
                 ):
-                    result = future.result(
-                        timeout=int(
-                            self.conf.get("collector", "process_execution_timeout")
+                    try:
+                        result = future.result(
+                            timeout=int(
+                                self.conf.get("collector", "process_execution_timeout")
+                            )
                         )
-                    )
-                    metrics.extend(result)
-                    log.debug("result = %s" % (result))
+                        metrics.extend(result)
+                        log.debug("result = %s" % (result))
+                    except keystoneauth1.exceptions.connection.ConnectTimeout as e:
+                        log.info("Keystone connection timeout during metric collection")
+                        log.debug("Keystone connection timeout exception %s" % (e))
             except concurrent.futures.TimeoutError as e:
                 # Some processes have not completed due to timeout error
                 log.info(