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

[config] Do not stop or restart dependent services when reloading config #582

Merged
merged 1 commit into from
Jul 25, 2019
Merged

[config] Do not stop or restart dependent services when reloading config #582

merged 1 commit into from
Jul 25, 2019

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented Jul 16, 2019

- What I did

Remove explicit calls to stop/restart services which are now dependent on SwSS.

As of sonic-net/sonic-buildimage#2546, teamd, snmp and dhcp_relay services will be stopped/started/restarted along with swss when it is stopped/started/restarted, respectively.

This prevents issues due to double restarts (e.g., this script would call systemctl restart swss, which would now cause teamd to restart, then shortly thereafter it would call systemctl restart teamd, which could lead to instability).

Now, stopping/starting/restarting swss will also stop/start/restart teamd, snmp, dhcp_relay and radv services, so we should no longer be stopping/starting/restarting them along with swss.

@jleveque jleveque added the Bug label Jul 16, 2019
@jleveque jleveque self-assigned this Jul 16, 2019
@jleveque jleveque changed the title [config] Do no stop or restart dependent services when reloading config [config] Do not stop or restart dependent services when reloading config Jul 16, 2019
@jleveque jleveque requested a review from lguohan July 16, 2019 19:49
'swss',
'snmp',
'lldp',
'pmon',
'bgp',
Copy link
Collaborator

@nazariig nazariig Jul 16, 2019

Choose a reason for hiding this comment

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

@jleveque can we also add swss.service dependency for bgp/lldp and eventually have similar behaviour as for teamd? The idea here is to have network and platform parts separated and fully managed by systemd. What do you think?

Copy link
Contributor Author

@jleveque jleveque Jul 16, 2019

Choose a reason for hiding this comment

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

@nazariig: Good suggestions. I'm all in favor of simplifying the service management. I opened a PR to add the same dependency for BGP here (sonic-net/sonic-buildimage#3078), but as you can see from the review comments, it appears there are corner cases, so we will need to think about a more intricate approach.

Regarding LLDP, it's not as imperative that we restart it along with SwSS. Now that we have lldpmgrd, anytime SwSS restarts it should get notified of port state changes and configure LLDP appropriately. It's not as critical as dhcp_relay or radv which have no way of being updated to port changes, but the dependency wouldn't hurt and would help simplify the service management, so I'd like to get @lguohan's opinion on this.

Update: Discussed with Guohan and confirmed that the eventual goal is to remove dependencies altogether, and make services independent as much as possible. As I mentioned above, with the addition of lldpmgrd, the LLDP service is no longer dependent on SwSS. The LLDP service can continue running while restarting SwSS. lldpmgrd will receive notifications when port statuses change, and it will reconfigure LLDP as appropriate. Thus, we should also be able to remove lldp from these lists, and not add it as a dependency of SwSS. I will work on this in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jleveque If swss service restarts in warm mode does it restart teamd?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As long as there is a call to systemctl [re]start swss, teamd and the other services which are configured with the same dependency on swss will also be [re]started.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jleveque I believe this breaks swss service level warm restart because teamd will recreate portchannels. Is it going to be fixed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yxieca / @pavel-shirshov to comment on teamd warm restart.

Copy link
Contributor

@yxieca yxieca Jul 17, 2019

Choose a reason for hiding this comment

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

@jleveque teamd is not a dependent of swss from what I see in current code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline. teamd is still dependent on swss. We will need a more elegant dependency solution in sonic-buildimage to handle the warm-restart case. But this PR should still be valid.

@jleveque
Copy link
Contributor Author

Retest this please

@nazariig
Copy link
Collaborator

@lguohan please have a look

@jleveque
Copy link
Contributor Author

Retest this please

1 similar comment
@jleveque
Copy link
Contributor Author

Retest this please

@jleveque
Copy link
Contributor Author

jleveque commented Sep 17, 2019

@yxieca: Now that sonic-net/sonic-buildimage#2852 has been merged into the 201811 branch, this PR should also be cherry-picked into the 201811 branch. Hopefully it will pick cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants