Skip to content

Commit

Permalink
UnavailableDataError for Key "COUNTERS_PORT_NAME_MAP" in COUNTERS_DB (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-chang3300 committed Oct 15, 2019
1 parent e364884 commit 49b7129
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/ax_interface/mib.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def __init__(self):
async def start(self):
# Run the update while we are allowed
while self.run_event.is_set():
# wait based on our update frequency before executing again.
# randomize to avoid concurrent update storms.
await asyncio.sleep(self.frequency + random.randint(-2, 2))

try:
# reinit internal structures
if self.update_counter > self.reinit_rate:
Expand All @@ -46,11 +50,7 @@ async def start(self):
self.update_data()
except Exception:
# Any unexpected exception or error, log it and keep running
logger.exception("MIBUpdater.start() caught an unexpected exception during update_data()")

# wait based on our update frequency before executing again.
# randomize to avoid concurrent update storms.
await asyncio.sleep(self.frequency + random.randint(-2, 2))
logger.warning("MIBUpdater.start() caught an unexpected exception during update_data()", exc_info=True)

def reinit_data(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@ def init_sync_d_queue_tables(db_conn):
if not port_queues_map:
# In the event no queue exists that follows the SONiC pattern, no OIDs are able to be registered.
# A RuntimeError here will prevent the 'main' module from loading. (This is desirable.)
logger.error("No queues found in the Counter DB. SyncD database is incoherent.")
logger.warning("No queues found in the Counter DB. SyncD database is incoherent.")
raise RuntimeError('The port_queues_map is not defined')
elif not queue_stat_map:
logger.error("No queue stat counters found in the Counter DB. SyncD database is incoherent.")
logger.warning("No queue stat counters found in the Counter DB. SyncD database is incoherent.")
raise RuntimeError('The queue_stat_map is not defined')

for queues in port_queue_list_map.values():
Expand Down

0 comments on commit 49b7129

Please sign in to comment.