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

[generic-config-updater] Add caclrule validator #2103

Merged
merged 5 commits into from
Mar 21, 2022

Conversation

wen587
Copy link
Contributor

@wen587 wen587 commented Mar 15, 2022

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)

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")
Copy link
Contributor

@qiluo-msft qiluo-msft Mar 16, 2022

Choose a reason for hiding this comment

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

os.system("sleep 1s")

python has time.sleep(). #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@qiluo-msft qiluo-msft left a 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.

@wen587
Copy link
Contributor Author

wen587 commented Mar 18, 2022

@renukamanavalan could you help review?

@renukamanavalan
Copy link
Contributor

@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)
Copy link
Contributor

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.

@wen587 wen587 merged commit b25f1e1 into sonic-net:master Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants