Add Endpoint::eager_connect_errors to surface lazy-channel connection failures immediately - #2841
Open
hermeGarcia wants to merge 2 commits into
Open
Add Endpoint::eager_connect_errors to surface lazy-channel connection failures immediately#2841hermeGarcia wants to merge 2 commits into
Endpoint::eager_connect_errors to surface lazy-channel connection failures immediately#2841hermeGarcia wants to merge 2 commits into
Conversation
LucioFranco
reviewed
Aug 28, 2026
Comment on lines
+130
to
131
| if self.return_connection_errors_on_poll() { | ||
| return Poll::Ready(Err(e.into())); |
Member
There was a problem hiding this comment.
I think this might cause problems, such as iirc tower will remove this connection from the readycache and make it never available again. I don't think that is the behavior you want right?
Contributor
Author
There was a problem hiding this comment.
Yes, we definitely don't want that.
Thanks for pointing it out!
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.
Fixes #2839.
Adds
Endpoint::eager_connect_errors(bool). When enabled, a lazily-connecting channel (Endpoint::connect_lazy/connect_with_connector_lazy) reports a failed connection attempt to the caller right away, instead of waiting till a call is made. This allows load balancers like tower's p2c to identify healthy endpoints before making an actual call.A new
fail_earlyfield/parameter on the internalReconnectservice, set fromendpoint.eager_connect_errorsat construction time inConnection::new.