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

sources/azure: prevent tight loops for DHCP retries #1285

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

cjp256
Copy link
Contributor

@cjp256 cjp256 commented Feb 21, 2022

With debug logging, tight loops may result in huge log file sizes, e.g.:
"Unable to find fallback nic"

  1. Raise NoDHCPLeaseMissingDhclientError to caller if no dhclient found
    instead of retrying DHCP, retrying will not fix a missing dhclient.

  2. For other DHCP failures, retry after sleeping one second.

Signed-off-by: Chris Patterson cpatterson@microsoft.com

Depends on #1276

Would be a good candidate for SRU, if possible.

@cjp256 cjp256 force-pushed the azure-dhcp-retry branch 3 times, most recently from c4fafc0 to 8f3460b Compare February 21, 2022 16:04
cloudinit/sources/DataSourceAzure.py Outdated Show resolved Hide resolved
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Overall looks good, but one inline comment/question and please rebase the previous merged PR into this one.

cloudinit/sources/DataSourceAzure.py Outdated Show resolved Hide resolved
@cjp256 cjp256 force-pushed the azure-dhcp-retry branch 3 times, most recently from b658333 to 4b12f46 Compare March 1, 2022 13:57
@cjp256
Copy link
Contributor Author

cjp256 commented Mar 1, 2022

Also updated the loop so we don't sleep if we're past the timeout.

@cjp256 cjp256 force-pushed the azure-dhcp-retry branch from 4b12f46 to a36086d Compare March 1, 2022 14:01
With debug logging, tight loops may result in huge log file sizes, e.g.:
"Unable to find fallback nic"

1. Raise NoDHCPLeaseMissingDhclientError to caller if no dhclient found
 instead of retrying DHCP, retrying will not fix a missing dhclient.

2. For other DHCP failures, retry after sleeping one second.

Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheRealFalcon TheRealFalcon merged commit 5d5117d into canonical:main Mar 2, 2022
@cjp256 cjp256 deleted the azure-dhcp-retry branch March 9, 2022 03:14
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.

3 participants