@@ -271,7 +271,7 @@ def init_sync_d_interface_tables(db_conn):
271
271
272
272
# { if_name (SONiC) -> sai_id }
273
273
# ex: { "Ethernet76" : "1000000000023" }
274
- if_name_map_util , if_id_map_util = port_util .get_interface_oid_map (db_conn )
274
+ if_name_map_util , if_id_map_util = port_util .get_interface_oid_map (db_conn , blocking = False )
275
275
for if_name , sai_id in if_name_map_util .items ():
276
276
if_name_str = if_name
277
277
if (re .match (port_util .SONIC_ETHERNET_RE_PATTERN , if_name_str ) or \
@@ -297,12 +297,8 @@ def init_sync_d_interface_tables(db_conn):
297
297
298
298
# SyncD consistency checks.
299
299
if not oid_name_map :
300
- # In the event no interface exists that follows the SONiC pattern, no OIDs are able to be registered.
301
- # A RuntimeError here will prevent the 'main' module from loading. (This is desirable.)
302
- message = "No interfaces found matching pattern '{}'. SyncD database is incoherent." \
303
- .format (port_util .SONIC_ETHERNET_RE_PATTERN )
304
- logger .error (message )
305
- raise RuntimeError (message )
300
+ logger .debug ("There are no ports in counters DB" )
301
+ return {}, {}, {}, {}
306
302
elif len (if_id_map ) < len (if_name_map ) or len (oid_name_map ) < len (if_name_map ):
307
303
# a length mismatch indicates a bad interface name
308
304
logger .warning ("SyncD database contains incoherent interface names. Interfaces must match pattern '{}'"
@@ -424,7 +420,7 @@ def init_sync_d_queue_tables(db_conn):
424
420
425
421
# { Port name : Queue index (SONiC) -> sai_id }
426
422
# ex: { "Ethernet0:2" : "1000000000023" }
427
- queue_name_map = db_conn .get_all (COUNTERS_DB , COUNTERS_QUEUE_NAME_MAP , blocking = True )
423
+ queue_name_map = db_conn .get_all (COUNTERS_DB , COUNTERS_QUEUE_NAME_MAP , blocking = False )
428
424
logger .debug ("Queue name map:\n " + pprint .pformat (queue_name_map , indent = 2 ))
429
425
430
426
# Parse the queue_name_map and create the following maps:
@@ -455,10 +451,8 @@ def init_sync_d_queue_tables(db_conn):
455
451
456
452
# SyncD consistency checks.
457
453
if not port_queues_map :
458
- # In the event no queue exists that follows the SONiC pattern, no OIDs are able to be registered.
459
- # A RuntimeError here will prevent the 'main' module from loading. (This is desirable.)
460
- logger .error ("No queues found in the Counter DB. SyncD database is incoherent." )
461
- raise RuntimeError ('The port_queues_map is not defined' )
454
+ logger .debug ("Counters DB does not contain ports" )
455
+ return {}, {}, {}
462
456
elif not queue_stat_map :
463
457
logger .error ("No queue stat counters found in the Counter DB. SyncD database is incoherent." )
464
458
raise RuntimeError ('The queue_stat_map is not defined' )
0 commit comments