Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202012] CPU Usage Spike Issue Handled #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def init_mgmt_interface_tables(db_conn):
if_alias_map = dict()

for if_name in oid_name_map.values():
if_entry = db_conn.get_all(CONFIG_DB, mgmt_if_entry_table(if_name), blocking=True)
if_entry = db_conn.get_all(CONFIG_DB, mgmt_if_entry_table(if_name), blocking=False)
if_alias_map[if_name] = if_entry.get('alias', if_name)

logger.debug("Management alias map:\n" + pprint.pformat(if_alias_map, indent=2))
Expand Down Expand Up @@ -283,7 +283,7 @@ def init_sync_d_interface_tables(db_conn):
if_alias_map = dict()

for if_name in if_name_map:
if_entry = db_conn.get_all(APPL_DB, if_entry_table(if_name), blocking=True)
if_entry = db_conn.get_all(APPL_DB, if_entry_table(if_name), blocking=False)
if_alias_map[if_name] = if_entry.get('alias', if_name)

logger.debug("Chassis name map:\n" + pprint.pformat(if_alias_map, indent=2))
Expand Down Expand Up @@ -353,7 +353,7 @@ def init_sync_d_queue_tables(db_conn):

# { Port name : Queue index (SONiC) -> sai_id }
# ex: { "Ethernet0:2" : "1000000000023" }
queue_name_map = db_conn.get_all(COUNTERS_DB, COUNTERS_QUEUE_NAME_MAP, blocking=True)
queue_name_map = db_conn.get_all(COUNTERS_DB, COUNTERS_QUEUE_NAME_MAP, blocking=False)
logger.debug("Queue name map:\n" + pprint.pformat(queue_name_map, indent=2))

# Parse the queue_name_map and create the following maps:
Expand Down
2 changes: 1 addition & 1 deletion src/sonic_ax_impl/mibs/ieee802_1ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def _get_if_entry(self, if_name):
else:
return None

return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=True)
return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=False)

def update_interface_data(self, if_name):
"""
Expand Down
6 changes: 3 additions & 3 deletions src/sonic_ax_impl/mibs/ietf/rfc1213.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def update_data(self):
ipnstr = routestr[len("ROUTE_TABLE:"):]
if ipnstr == "0.0.0.0/0":
ipn = ipaddress.ip_network(ipnstr)
ent = Namespace.dbs_get_all(self.db_conn, mibs.APPL_DB, routestr, blocking=True)
ent = Namespace.dbs_get_all(self.db_conn, mibs.APPL_DB, routestr, blocking=False)
nexthops = ent["nexthop"]
for nh in nexthops.split(','):
# TODO: if ipn contains IP range, create more sub_id here
Expand Down Expand Up @@ -229,7 +229,7 @@ def update_data(self):
namespace, sai_id = mibs.split_sai_id_key(sai_id_key)
if_idx = mibs.get_index_from_str(self.if_id_map[sai_id_key])
self.if_counters[if_idx] = self.namespace_db_map[namespace].get_all(mibs.COUNTERS_DB, \
mibs.counter_table(sai_id), blocking=True)
mibs.counter_table(sai_id), blocking=False)

self.lag_name_if_name_map, \
self.if_name_lag_name_map, \
Expand Down Expand Up @@ -357,7 +357,7 @@ def _get_if_entry(self, sub_id):
else:
return None

return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=True)
return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=False)

def _get_if_entry_state_db(self, sub_id):
"""
Expand Down
4 changes: 2 additions & 2 deletions src/sonic_ax_impl/mibs/ietf/rfc2863.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def update_data(self):
namespace, sai_id = mibs.split_sai_id_key(sai_id_key)
if_idx = mibs.get_index_from_str(self.if_id_map[sai_id_key])
self.if_counters[if_idx] = self.namespace_db_map[namespace].get_all(mibs.COUNTERS_DB, \
mibs.counter_table(sai_id), blocking=True)
mibs.counter_table(sai_id), blocking=False)

def get_next(self, sub_id):
"""
Expand Down Expand Up @@ -222,7 +222,7 @@ def _get_if_entry(self, sub_id):
else:
return None

return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=True)
return Namespace.dbs_get_all(self.db_conn, db, if_table, blocking=False)

def get_high_speed(self, sub_id):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sonic_ax_impl/mibs/ietf/rfc4363.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def update_data(self):
mibs.logger.error("SyncD 'ASIC_DB' includes invalid FDB_ENTRY '{}': {}.".format(fdb_str, e))
continue

ent = Namespace.dbs_get_all(self.db_conn, mibs.ASIC_DB, s, blocking=True)
ent = Namespace.dbs_get_all(self.db_conn, mibs.ASIC_DB, s, blocking=False)
# Example output: oid:0x3a000000000608
bridge_port_id = ent["SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID"][6:]
if bridge_port_id not in self.if_bpid_map:
Expand Down
2 changes: 1 addition & 1 deletion src/sonic_ax_impl/mibs/vendor/cisco/ciscoPfcExtMIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def update_data(self):
namespace, sai_id = mibs.split_sai_id_key(sai_id_key)
if_idx = mibs.get_index_from_str(self.if_id_map[sai_id_key])
self.if_counters[if_idx] = self.namespace_db_map[namespace].get_all(mibs.COUNTERS_DB, \
mibs.counter_table(sai_id), blocking=True)
mibs.counter_table(sai_id), blocking=False)

self.lag_name_if_name_map, \
self.if_name_lag_name_map, \
Expand Down