-
Notifications
You must be signed in to change notification settings - Fork 271
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
dns: Avoid allocating in Name::is_localhost
#1303
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`Name::is_localhost` implements comparison by parsing the string `localhost.` as a Name. This requires constructing a `String` as well as performing name parsing. We can avoid this work by obtaining a reference to the inner name string and using [`str::eq_ignore_ascii_case`][1]. [1]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.eq_ignore_ascii_case
hawkw
approved these changes
Oct 7, 2021
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.
👍
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Oct 19, 2021
This release fixes a bug where the outbound proxy could loop infinitely while handling errors on meshed HTTP/1 connections. This would typically cause proxies to be fail health checks and be restarted. Furthermore, the proxy now requires identity. Proxies will log an error and fail to start if identity is disabled. --- * dns: Avoid allocating in `Name::is_localhost` (linkerd/linkerd2-proxy#1303) * metrics: Implement FmtMetrics for Option (linkerd/linkerd2-proxy#1302) * tracing: simplify subscriber construction with `Box`ed layers (linkerd/linkerd2-proxy#1304) * Require identity configuration (linkerd/linkerd2-proxy#1305) * build(deps): bump thiserror from 1.0.29 to 1.0.30 (linkerd/linkerd2-proxy#1306) * build(deps): bump tower from 0.4.8 to 0.4.9 (linkerd/linkerd2-proxy#1308) * build(deps): bump trust-dns-resolver (linkerd/linkerd2-proxy#1311) * build(deps): bump actions/checkout from 2.3.4 to 2.3.5 (linkerd/linkerd2-proxy#1313) * dns-name: Remove `webpki` dependency (linkerd/linkerd2-proxy#1316) * build(deps): bump libc from 0.2.103 to 0.2.104 (linkerd/linkerd2-proxy#1315) * inbound: Add a box layer to reduce compile times (linkerd/linkerd2-proxy#1317) * Split cryptographic dependencies into a dedicated crate (linkerd/linkerd2-proxy#1307) * Fix an infinite loop when downgrading HTTP/2 errors (linkerd/linkerd2-proxy#1318)
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Oct 20, 2021
This release fixes a bug where the outbound proxy could loop infinitely while handling errors on meshed HTTP/1 connections. This would typically cause proxies to be fail health checks and be restarted. Furthermore, the proxy now requires identity. Proxies will log an error and fail to start if identity is disabled. --- * dns: Avoid allocating in `Name::is_localhost` (linkerd/linkerd2-proxy#1303) * metrics: Implement FmtMetrics for Option (linkerd/linkerd2-proxy#1302) * tracing: simplify subscriber construction with `Box`ed layers (linkerd/linkerd2-proxy#1304) * Require identity configuration (linkerd/linkerd2-proxy#1305) * build(deps): bump thiserror from 1.0.29 to 1.0.30 (linkerd/linkerd2-proxy#1306) * build(deps): bump tower from 0.4.8 to 0.4.9 (linkerd/linkerd2-proxy#1308) * build(deps): bump trust-dns-resolver (linkerd/linkerd2-proxy#1311) * build(deps): bump actions/checkout from 2.3.4 to 2.3.5 (linkerd/linkerd2-proxy#1313) * dns-name: Remove `webpki` dependency (linkerd/linkerd2-proxy#1316) * build(deps): bump libc from 0.2.103 to 0.2.104 (linkerd/linkerd2-proxy#1315) * inbound: Add a box layer to reduce compile times (linkerd/linkerd2-proxy#1317) * Split cryptographic dependencies into a dedicated crate (linkerd/linkerd2-proxy#1307) * Fix an infinite loop when downgrading HTTP/2 errors (linkerd/linkerd2-proxy#1318)
olix0r
added a commit
that referenced
this pull request
Oct 22, 2021
`Name::is_localhost` implements comparison by parsing the string `localhost.` as a Name. This requires constructing a `String` as well as performing name parsing. We can avoid this work by obtaining a reference to the inner name string and using [`str::eq_ignore_ascii_case`][1]. [1]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.eq_ignore_ascii_case
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Name::is_localhost
implements comparison by parsing the stringlocalhost.
as a Name. This requires constructing aString
as well asperforming name parsing. We can avoid this work by obtaining a reference
to the inner name string and using
str::eq_ignore_ascii_case
.