-
Notifications
You must be signed in to change notification settings - Fork 49
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
Collect connection address in connectivity test #223
Open
fortuna
wants to merge
10
commits into
main
Choose a base branch
from
fortuna-address
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
60e4afb
Collect connection address
fortuna ebecc1f
Try intercepting the transport dialer
fortuna 21e0e1b
Pass wrapper instead
fortuna 577829f
Clean up
fortuna 85269c2
Comment
fortuna 8541f46
Merge branch 'main' into fortuna-address
fortuna db2f334
Collect connections
fortuna 96ae7fb
Fix
fortuna 7542c5a
Timeout
fortuna 7d8d602
To fix
fortuna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
I tried to intercept the streamDialer instead of the baseDialer, but it didn't work because the RemoteAddress is for the target in the PacketListenerDialer. Code: https://github.com/Jigsaw-Code/outline-sdk/compare/fortuna-address2?expand=1
It's not clear what the RemoteTarget should be, so I'm not sure that is a god approach. I think I prefer to keep this base dialer interception. But we could think about some sort of event listener instead, to reduce wrapping.
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.
@fortuna I like the idea of intercept the streamDialer. btw in the suggested implementation, if connect fails and conn is nil, connectionAddress will be left empty and we don't know what endpoint was attempted. I can address this by extracting attempted endpoint from err by assessing error type with
err.(*net.OpError)
.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.
You have the dialed address in the transport specification.
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.
I updated the PR. We now have functions that can test dialer wrappers, since the one that takes the resolver was not enough.
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.
Oh, I see your point. We won't have the address for errors, so it's hard to tell if it's a bad resolution, for instance.
I think we can extend the code to do Happy Eyeballs or Dialer.ControlContext. But perhaps in another PR.
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.
If multiple endpoints are attempted, which one do we select? The first one? The last one? All of them? Perhaps we need to collect all of them, then specify which one we picked for the transport part.
I don't think we are able to capture all of them by looking at the error. We need to do the resolution ourselves.
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.
It is still a bit clunky, but I think the data model is better aligned. Example: