Skip to content
New issue

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

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

Already on GitHub? # to your account

[config reload] Call systemctl reset-failed for snmp,telemetry,mgmt-framework services #1773

Merged
merged 2 commits into from
Aug 26, 2021

Conversation

Junchao-Mellanox
Copy link
Collaborator

What I did

When issue config reload -y or config load_minigraph -y command, most of the sonic services will be reset by command systemctl reset-failed <service_name>. The purpose is to avoid services reach to its start retry limit and cannot be started. However, systemctl reset-failed only resets those services belong to sonic.target, snmp, telemetry and mgmt-framework are not part of them. So if we run config reload -y or config load_minigraph -y continues, snmp, telemetry and mgmt-framework services might enter into failed state. This PR is to fix the issue.

I would like to cherry-pick this fix to 202012 branch, but this fix also depends on PR sonic-net/sonic-buildimage#7846. So if we decide to cherry-pick this PR to 202012, we need cherry-pick sonic-net/sonic-buildimage#7846 first.

How I did it

Also call systemctl reset-failed for services like snmp, telemetry and mgmt-framework.

How to verify it

Manual test.

Previous command output (if the output of a command-line utility has changed)

No command output changes.

New command output (if the output of a command-line utility has changed)

No command output changes.

@@ -681,11 +681,16 @@ def _stop_services():

def _get_sonic_services():
out = clicommon.run_command("systemctl list-dependencies --plain sonic.target | sed '1d'", return_cmd=True)
return [unit.strip() for unit in out.splitlines()]
return (unit.strip() for unit in out.splitlines())
Copy link
Contributor

@qiluo-msft qiluo-msft Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)

Is there any problem when using list instead of tuple? #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a generator. I suppose generator is more efficiency.

a = (str(x) for x in range(10))
print(type(a))

Output:

<class 'generator'>

@@ -55,7 +55,7 @@ def test_load_minigraph(self, get_cmd_module, setup_single_broadcom_asic):
traceback.print_tb(result.exc_info[2])
assert result.exit_code == 0
assert "\n".join([l.rstrip() for l in result.output.split('\n')]) == load_minigraph_command_output
assert mock_run_command.call_count == 7
assert mock_run_command.call_count == 8
Copy link
Contributor

@qiluo-msft qiluo-msft Aug 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call_count

Could you test your feature/fix in this test case? #Closed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Added a few checks in this test case, please help review.

@qiluo-msft qiluo-msft merged commit f5ce87a into sonic-net:master Aug 26, 2021
judyjoseph pushed a commit that referenced this pull request Aug 26, 2021
…ramework services (#1773)

#### What I did

When issue `config reload -y` or `config load_minigraph -y` command, most of the sonic services will be reset by command `systemctl reset-failed <service_name>`. The purpose is to avoid services reach to its start retry limit and cannot be started. However, `systemctl reset-failed` only resets those services belong to sonic.target, snmp, telemetry and mgmt-framework are not part of them. So if we run `config reload -y` or `config load_minigraph -y` continues, snmp, telemetry and mgmt-framework services might enter into failed state. This PR is to fix the issue.

I would like to cherry-pick this fix to 202012 branch, but this fix also depends on PR sonic-net/sonic-buildimage#7846. So if we decide to cherry-pick this PR to 202012, we need cherry-pick sonic-net/sonic-buildimage#7846 first.

#### How I did it

Also call `systemctl reset-failed` for services like snmp, telemetry and mgmt-framework. 

#### How to verify it

Manual test.
@qiluo-msft
Copy link
Contributor

This PR could not be cleanly cherry-pick to 202012. Please submit another PR.

Junchao-Mellanox added a commit to Junchao-Mellanox/sonic-utilities that referenced this pull request Aug 27, 2021
…ramework services (sonic-net#1773)

When issue `config reload -y` or `config load_minigraph -y` command, most of the sonic services will be reset by command `systemctl reset-failed <service_name>`. The purpose is to avoid services reach to its start retry limit and cannot be started. However, `systemctl reset-failed` only resets those services belong to sonic.target, snmp, telemetry and mgmt-framework are not part of them. So if we run `config reload -y` or `config load_minigraph -y` continues, snmp, telemetry and mgmt-framework services might enter into failed state. This PR is to fix the issue.

I would like to cherry-pick this fix to 202012 branch, but this fix also depends on PR sonic-net/sonic-buildimage#7846. So if we decide to cherry-pick this PR to 202012, we need cherry-pick sonic-net/sonic-buildimage#7846 first.

Also call `systemctl reset-failed` for services like snmp, telemetry and mgmt-framework.

Manual test.
+
@qiluo-msft
Copy link
Contributor

This commit could not be cleanly cherry-pick to 202012. Please submit another PR.

qiluo-msft pushed a commit that referenced this pull request Aug 30, 2021
…ramework services (#1773) (#1786)

Back port PR #1773 to 202012 branch.

#### What I did

When issue `config reload -y` or `config load_minigraph -y` command, most of the sonic services will be reset by command `systemctl reset-failed <service_name>`. The purpose is to avoid services reach to its start retry limit and cannot be started. However, `systemctl reset-failed` only resets those services belong to sonic.target, snmp, telemetry and mgmt-framework are not part of them. So if we run `config reload -y` or `config load_minigraph -y` continues, snmp, telemetry and mgmt-framework services might enter into failed state. This PR is to fix the issue.

#### How I did it

Also call `systemctl reset-failed` for services like snmp, telemetry and mgmt-framework. 

#### How to verify it

Manual test.
@Junchao-Mellanox Junchao-Mellanox deleted the fix-service-rate-limit branch October 29, 2021 01:46
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 18, 2022
…627)

7041400 [config reload] Call systemctl reset-failed for snmp,telemetry,mgmt-framework services (sonic-net#1773) (sonic-net#1786)
399d370 Fix logic in RIF counters print (sonic-net#1732)
8329544 [vnet_route_check] don't hardcode prefix length of /24 (sonic-net#1756)
193b028 [neighbor-advertiser] delete the tunnel maps appropriately (sonic-net#1663)
2c82bcf [neighbor_advertiser] Use existing tunnel if present for creating tunnel mappings (sonic-net#1589)
8e22960 [202012][Config] Update config command of Kdump. (sonic-net#1778)
be3e5c6 [show][config] cli refactor for muxcable with abstract class implementation from vendors (sonic-net#1722) (sonic-net#1782)
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants