Skip to content

Commit

Permalink
Following changes are done:
Browse files Browse the repository at this point in the history
1. For config reload/minigraph stop and re-enable routeCheck because
with large route scale of 70K+ routes this can log monit error
transiently which can also fail in sonic-mgmt.
2. Also make API is_bgp_suppress_enable as this can return backtrace in
config reload/minigraph as bgp containe rmight not be up and running.

Signed-off-by: Abhishek Dosi <[email protected]>
  • Loading branch information
abdosi committed Dec 16, 2024
1 parent 3561996 commit 01ba552
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
14 changes: 8 additions & 6 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,9 @@ def _get_disabled_services_list(config_db):
def _stop_services():
try:
subprocess.check_call(['sudo', 'monit', 'status'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
click.echo("Disabling container monitoring ...")
click.echo("Disabling container and routeCheck monitoring ...")
clicommon.run_command(['sudo', 'monit', 'unmonitor', 'container_checker'])
clicommon.run_command(['sudo', 'monit', 'unmonitor', 'routeCheck'])
except subprocess.CalledProcessError as err:
pass

Expand Down Expand Up @@ -946,17 +947,18 @@ def _restart_services():
wait_service_restart_finish('interfaces-config', last_interface_config_timestamp)
wait_service_restart_finish('networking', last_networking_timestamp)

# Reload Monit configuration to pick up new hostname in case it changed
click.echo("Reloading Monit configuration ...")
clicommon.run_command(['sudo', 'monit', 'reload'])

try:
subprocess.check_call(['sudo', 'monit', 'status'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
click.echo("Enabling container monitoring ...")
click.echo("Enabling container and routeCheck monitoring ...")
clicommon.run_command(['sudo', 'monit', 'monitor', 'container_checker'])
clicommon.run_command(['sudo', 'monit', 'monitor', 'routeCheck'])
except subprocess.CalledProcessError as err:
pass

# Reload Monit configuration to pick up new hostname in case it changed
click.echo("Reloading Monit configuration ...")
clicommon.run_command(['sudo', 'monit', 'reload'])

def _per_namespace_swss_ready(service_name):
out, _ = clicommon.run_command(['systemctl', 'show', str(service_name), '--property', 'ActiveState', '--value'], return_cmd=True)
if out.strip() != "active":
Expand Down
7 changes: 2 additions & 5 deletions scripts/route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,9 @@ def get_asicdb_routes(namespace):

def is_bgp_suppress_fib_pending_enabled(namespace):
"""
Retruns True if FIB suppression is enabled in BGP config, False otherwise
On 202405 image this feature is not supported so always return False
"""
show_run_cmd = ['show', 'runningconfiguration', 'bgp', '-n', namespace]

output = subprocess.check_output(show_run_cmd, text=True)
return 'bgp suppress-fib-pending' in output
return False


def is_suppress_fib_pending_enabled(namespace):
Expand Down

0 comments on commit 01ba552

Please sign in to comment.