-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Pyamqp] Remember Proxy Params #25564
Merged
kashifkhan
merged 5 commits into
Azure:feature/eventhub/pyproto
from
kashifkhan:eh_pyamqp_proxy
Aug 8, 2022
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
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 think we'll need to make the same change in async as well. Is there any way to test this? I'm guessing not since we don't have an http_proxy test in EH or a lot of pyamqp tests.
But maybe for now, we can just create a client and check client._handler._auth._transport._http_proxy is set to what we passed in, without actually sending? Thoughts?
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.
Good catch !!
Can't really test this because of the reasons you outlined (though there are convos about adding some proxy based tests into the pipeline).
The other reason is that just creating a client simply keeps the proxy information inside
client._config.http_proxy
and that it does properly. Since we lazily create Connections, nothing happens till you do something likecreate_batch
etc. Its then when proxy stuff gets passed around and its truly right as its connecting insideWebSocketTransport
that it looks for whats sent in and tries to apply it.I can add in a unit test in to pyamqp so that we can make sure the behavior is maintained over changes.
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.
that makes sense. one other idea: would a negative test be possible? for ex, if you pass in an invalid http proxy arg, it would raise the correct error since you haven't actually set up a proxy. This would specifically test against the error that you're fixing, which was that it was sending anyway despite http proxy arg being invalid.