-
Notifications
You must be signed in to change notification settings - Fork 661
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
[generic-config-updater] Add caclrule validator #2103
Conversation
if (old_aclrule.get(key, {}) != upd_aclrule.get(key, {})): | ||
# caclmgrd will update in 0.5 sec when configuration stops, | ||
# we sleep 1 sec to make sure it does update. | ||
rc = os.system("sleep 1s") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to check the test cmds https://github.com/Azure/sonic-utilities/blob/13f88c1aad4c6a5293fef978b7affb95335d1f04/tests/generic_config_updater/service_validator_test.py#L106 also avoid conflict use with
https://github.com/Azure/sonic-utilities/blob/13f88c1aad4c6a5293fef978b7affb95335d1f04/generic_config_updater/services_validator.py#L37
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please check with other reviewers.
@renukamanavalan could you help review? |
@prsunny, can you please help? |
if (old_aclrule.get(key, {}) != upd_aclrule.get(key, {})): | ||
# caclmgrd will update in 0.5 sec when configuration stops, | ||
# we sleep 1 sec to make sure it does update. | ||
time.sleep(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, this is a blind sleep. If caclmgrd
is changed in future to wait 1sec, we may have to revisit here. I don't have a better suggestion though.
After the json patch could be gathered in some way, it should fix nightly random failure issue.
What I did
When gcu make change to control plane ACL_RULE, the iptables doen't change immediately. There is a delay because caclmgr will update in 0.5 sec if no more update being made to config. So I add a caclrule validator to make sure the iptable is updated.
How I did it
When caclrule is being changed, add a 1sec sleep to make sure caclmgr does update.
How to verify it
Run sonic-utilities unit test
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)