Skip to content

Fail fast optimization to is_resolvable.#6766

Closed
joe-usa-amzn wants to merge 1 commit into
canonical:mainfrom
joe-usa-amzn:is_resolvable_fix
Closed

Fail fast optimization to is_resolvable.#6766
joe-usa-amzn wants to merge 1 commit into
canonical:mainfrom
joe-usa-amzn:is_resolvable_fix

Conversation

@joe-usa-amzn
Copy link
Copy Markdown
Contributor

Proposed Commit Message

On top of this previous optimization to is_resolvable: https://github.com/canonical/cloud-init/pull/2040
an additonal optimization is to fail early when the hostname is not resolvable at all.  
Original author Perez Pestana, Alejandro <aalepp@amazon.com>

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@holmanb holmanb self-assigned this Feb 23, 2026
@holmanb
Copy link
Copy Markdown
Member

holmanb commented Feb 24, 2026

Is there any reason the author can't submit this code themselves?

When do you expect this to happen?

Please provide logs where where you observed poor performance, as well as logs from a system with this change applied.

@joe-usa-amzn
Copy link
Copy Markdown
Contributor Author

Hi @holmanb, I obtained permission from the original author to contribute this as I am the designated cloud-init SME for our team.
This is not a performance optimization as much as an optimization against badname checking from being called. The issue was our DNS service route 53 saw a bunch of calls to "does-not-exist.example.com.", "example.invalid.", "cloud_init_expected_not_found" and after these changes and the one mentioned here: #2040 we were able to reduce the number of DNS calls to these junk addresses. As far as logging you wouldn't find anything different in cloud-init.log unless you trigger this redirect attack. I can try to ask around for the route 53 logs if you need, but it's been almost year since we added this change in Amazon Linux and it has been stable ever since.

@joe-usa-amzn
Copy link
Copy Markdown
Contributor Author

Would you like to see anything else? @holmanb

@holmanb
Copy link
Copy Markdown
Member

holmanb commented Feb 27, 2026

That is insufficient, sorry. Please have the author contribute it.

@holmanb holmanb closed this Feb 27, 2026
@joe-usa-amzn
Copy link
Copy Markdown
Contributor Author

I will have him do so, thanks for taking a look.

@holmanb
Copy link
Copy Markdown
Member

holmanb commented Feb 27, 2026

I will have him do so, thanks for taking a look.

Thank you.

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.

2 participants