refactor(app/core): outline control plane recovery backoff#4450
Open
refactor(app/core): outline control plane recovery backoff#4450
Conversation
`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. Signed-off-by: katelyn martin <kate@buoyant.io>
unleashed
reviewed
Mar 12, 2026
Comment on lines
+322
to
+329
| // If we are recovering due to a DNS resolution error, check for a negative TTL. | ||
| if let Some(e) = crate::errors::cause_ref::<dns::ResolveError>(&*error) { | ||
| if let Some(ttl) = e.negative_ttl() { | ||
| let interval = tokio::time::interval(ttl); | ||
| let stream = IntervalStream::new(interval); | ||
| return Ok(ResolveBackoff::NegativeTtl(stream)); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
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?
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.
linkerd_app_core::controlprovides utilities used by the data plane tocommunicate 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.
Signed-off-by: katelyn martin kate@buoyant.io