[generic-config-updater] Add caclrule validator#2103
[generic-config-updater] Add caclrule validator#2103wen587 merged 5 commits intosonic-net:masterfrom
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.
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
qiluo-msft
left a comment
There was a problem hiding this comment.
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.
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)