Conversation
pothos
referenced
this pull request
in kinvolk-archives/linkerd2-proxy
Jun 13, 2019
Draft profiling setup for flamegraphs
sprt
pushed a commit
to sprt/linkerd2-proxy
that referenced
this pull request
Aug 30, 2019
Update versions in code. Use default docker tag of v0.1.0
cratelyn
added a commit
that referenced
this pull request
Mar 18, 2026
this commit provides a follow-up to #4450, fixing a bug with existing code identified during review by @Unleased. > I know this is just keeping the existing behavior, but isn't tokio::time::interval() going to fire immediately so we'll retry right away? \- #4450 (comment) this commit inserts a call to `tokio::time::Interval::reset()` to the `Recover` implementation that extracts negative TTL's from `hickory_resolver` errors. this means that, upon resolution errors with a negative TTL, we will no longer immediately retry, and instead wait for the prescribed time before attempting once more. introducing test coverage for this is difficult because we cannot create a `ResolveError` ourselves, and introducing e.g. a trait to inject here would incur an excessive amount of boilerplate and complexity. to provide assurance that this is correct, see this small playground example, in which we poll an `Interval` with and without this call to `reset()`. note that when calling reset, it will no longer immediately return `Poll::Ready(_)` upon the first call to `tick()`. ```rust #[tokio::main] async fn main() { let duration = std::time::Duration::from_secs(1); let mut interval = tokio::time::interval(duration); // interval.reset(); let start = std::time::Instant::now(); for i in 1..5 { interval.tick().await; let elapsed = start.elapsed().as_millis(); println!("#{i} - {elapsed}ms") } } ``` ``` ; cargo run #1 - 1ms #2 - 1001ms #3 - 2001ms #4 - 3001ms ``` with a reset, to avoid first poll being ready: ```rust #[tokio::main] async fn main() { let duration = std::time::Duration::from_secs(1); let mut interval = tokio::time::interval(duration); interval.reset(); let start = std::time::Instant::now(); for i in 1..5 { interval.tick().await; let elapsed = start.elapsed().as_millis(); println!("#{i} - {elapsed}ms") } } ``` ``` ; cargo run #1 - 1001ms #2 - 2001ms #3 - 3001ms #4 - 4001ms ``` Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn
added a commit
that referenced
this pull request
Mar 20, 2026
* fix(app/core): fix negative ttl immediate return this commit provides a follow-up to #4450, fixing a bug with existing code identified during review by @Unleased. > I know this is just keeping the existing behavior, but isn't tokio::time::interval() going to fire immediately so we'll retry right away? \- #4450 (comment) this commit inserts a call to `tokio::time::Interval::reset()` to the `Recover` implementation that extracts negative TTL's from `hickory_resolver` errors. this means that, upon resolution errors with a negative TTL, we will no longer immediately retry, and instead wait for the prescribed time before attempting once more. introducing test coverage for this is difficult because we cannot create a `ResolveError` ourselves, and introducing e.g. a trait to inject here would incur an excessive amount of boilerplate and complexity. to provide assurance that this is correct, see this small playground example, in which we poll an `Interval` with and without this call to `reset()`. note that when calling reset, it will no longer immediately return `Poll::Ready(_)` upon the first call to `tick()`. ```rust #[tokio::main] async fn main() { let duration = std::time::Duration::from_secs(1); let mut interval = tokio::time::interval(duration); // interval.reset(); let start = std::time::Instant::now(); for i in 1..5 { interval.tick().await; let elapsed = start.elapsed().as_millis(); println!("#{i} - {elapsed}ms") } } ``` ``` ; cargo run #1 - 1ms #2 - 1001ms #3 - 2001ms #4 - 3001ms ``` with a reset, to avoid first poll being ready: ```rust #[tokio::main] async fn main() { let duration = std::time::Duration::from_secs(1); let mut interval = tokio::time::interval(duration); interval.reset(); let start = std::time::Instant::now(); for i in 1..5 { interval.tick().await; let elapsed = start.elapsed().as_millis(); println!("#{i} - {elapsed}ms") } } ``` ``` ; cargo run #1 - 1001ms #2 - 2001ms #3 - 3001ms #4 - 4001ms ``` Signed-off-by: katelyn martin <kate@buoyant.io> * nit(app/core): fix comment typo #4455 (comment) Co-authored-by: Alejandro Martinez Ruiz <alex@flawedcode.org> --------- Signed-off-by: katelyn martin <kate@buoyant.io> Co-authored-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
cratelyn
added a commit
that referenced
this pull request
Mar 20, 2026
`linkerd_app_core::control` provides utilities used by the data plane to communicate with the linkerd control plane. this includes, among other features such as load-balancing and configurability for settings like connection timeout durations, an error recovery that respects DNS record's negative TTL. as of today, we do this within an inline, anonymous closure. this commit pulls this business logic out of an inline closure, and into an explicit pair of structures. ResolveRecover is the Recover implementation that handles identifying the proper backoff strategy, when presented with a given boxed error. ResolveBackoff is the structure that acts as the sum type that encompasses either a TTL-driven interval, or an exponential backoff. see also, #4449. that introduces some additional guardrails to prevent panicking if a negative ttl of zero is encountered. as part of this code motion, this commit inserts a call to `tokio::time::Interval::reset()` to the `Recover` implementation that extracts negative TTL's from `hickory_resolver` errors. this means that, upon resolution errors with a negative TTL, we will no longer immediately retry, and instead wait for the prescribed time before attempting once more. introducing test coverage for this is difficult because we cannot create a `ResolveError` ourselves, and introducing e.g. a trait to inject here would incur an excessive amount of boilerplate and complexity. to provide assurance that this is correct, see this small playground example, in which we poll an `Interval` with and without this call to `reset()`. note that when calling reset, it will no longer immediately return `Poll::Ready(_)` upon the first call to `tick()`. ```rust #[tokio::main] async fn main() { let duration = std::time::Duration::from_secs(1); let mut interval = tokio::time::interval(duration); // interval.reset(); let start = std::time::Instant::now(); for i in 1..5 { interval.tick().await; let elapsed = start.elapsed().as_millis(); println!("#{i} - {elapsed}ms") } } ``` ``` ; cargo run #1 - 1ms #2 - 1001ms #3 - 2001ms #4 - 3001ms ``` with a reset, to avoid first poll being ready: ```rust #[tokio::main] async fn main() { let duration = std::time::Duration::from_secs(1); let mut interval = tokio::time::interval(duration); interval.reset(); let start = std::time::Instant::now(); for i in 1..5 { interval.tick().await; let elapsed = start.elapsed().as_millis(); println!("#{i} - {elapsed}ms") } } ``` ``` ; cargo run #1 - 1001ms #2 - 2001ms #3 - 3001ms #4 - 4001ms ``` Signed-off-by: katelyn martin <kate@buoyant.io> Co-authored-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
This file contains hidden or 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
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.
No description provided.