Fix ctrmgrd occasionally restart service problem#13342
Closed
kuanyu99 wants to merge 1 commit intosonic-net:masterfrom
Closed
Fix ctrmgrd occasionally restart service problem#13342kuanyu99 wants to merge 1 commit intosonic-net:masterfrom
kuanyu99 wants to merge 1 commit intosonic-net:masterfrom
Conversation
* Originally, the container script will set the current_owner to none when it try to stop that feature. Later, when the container script want to start the feature, it will set local/kube as the owner and then start it. However, the ctrmgrd.py will do the same thing for the feature. It will try to restart the feature when the owner changed from none to local. The function of ctrmgrd is duplicate of the container script. * Prevent the ctrmgrd.py from restarting the feature when the owner is changed from none to local.
Contributor
Author
|
I found the PR-#12997 can fix the same problem. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
After I enable the Kubernetes on the SONiC, the database container keeps restarting.
And I will keep seeing the following message.
How I did it
Due to the current_owner "none" is the default state for the container, I intend to make the ctrmgrd skip changing the state of the container. This operation should be handled by the "container" script instead of the "ctrmgrd.py".
In the set_owner="kube" condition, it also ignores the case when the current_owner equal to "none".
How to verify it
After the change, the containers will not be restarted by the ctrmgrd.py unintentionally.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Originally, the container script will set the current_owner to none when it try to stop that feature. Later, when the container script want to start the feature, it will set local/kube as the owner and then start it. However, the ctrmgrd.py will do the same thing for the feature. It will try to restart the feature when the owner changed from none to local. The function of ctrmgrd is duplicate of the container script.
Prevent the ctrmgrd.py from restarting the feature when the owner is changed from none to local.
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)