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
# Wait for future calls to complete till process_execution_timeout. Default is 50 seconds
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')))
- metrics.extend(result)
- log.debug('result = %s' % (result))
+ try:
+ result = future.result(timeout=int(self.conf.get('collector',
+ 'process_execution_timeout')))
+ metrics.extend(result)
+ log.debug('result = %s' % (result))
+ except keystoneauth1.exceptions.connection.ConnectionError as e:
+ log.info("Keystone connection error during metric collection")
+ log.debug("Keystone connection error exception %s" % (e))
except concurrent.futures.TimeoutError as e:
# Some processes have not completed due to timeout error
log.info('Some processes have not finished due to TimeoutError exception')