Skip to content

Assert that run_connection_attempts does not break out of the loop with connection attempts left to try - #8459

Open
link2xt wants to merge 3 commits into
mainfrom
link2xt/run-connection-attempts-testing
Open

Assert that run_connection_attempts does not break out of the loop with connection attempts left to try#8459
link2xt wants to merge 3 commits into
mainfrom
link2xt/run-connection-attempts-testing

Conversation

@link2xt

@link2xt link2xt commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Also added basic test and updated the comment.

Comment thread src/net.rs
all_errors.push(err);
}
Err(err) => {
break Err(err);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this breaking out effectively discard all_errors and remaining candidates are ignored?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is a JoinError (see https://docs.rs/tokio/latest/tokio/task/struct.JoinSet.html#method.join_next) which means the task was cancelled (we never do it, we do not save the result of connection_attempt_set.spawn()) or panicked. So this is error should never happen, if it does everything will be cancelled with a "Failed to join task" error returned.

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