Add Unix Domain Socket support to RequestsWrapper #7585
Merged
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.
What does this PR do?
Add support for performing HTTP requests to
unix://...
URLs toRequestsWrapper
.Example:
Note: Contrary to what I thought initially, in the end we don't need the user to take any action re:
persist_connections
. We automatically use the shared session in this case, since we need to mount the adapter on a session and this is not supported by just using therequests
top-level API as we do in the default non-persisted case. There's work planned to pay off this bit of tech debt so we build a session in the same way in both cases (more context in #7579 and #7582).Motivation
Required for the upcoming IoT Edge integration (#7465), and currently marked as TODO in our developer docs.
Additional Notes
QA notes
Note: please QA this on Windows too. If you don't have a Windows machine, either use a Cloud VM (Azure) or kindly pass the card along to someone who has when you're done. 🙏
There's a bug in Docker that prevents sharing Unix sockets between the host and a container (see docker/for-mac#483). This means doing integration/e2e tests on macOS is not possible (only possible on Linux or Windows). If you want to save yourself from spinning up a Linux/Windows VM, here's on way to test this feature using the macOS host Agent…
First, install the macOS RC build on your machine.
Then, run this script to start a local UDS server (Python 3 only):
Verify the server works:
Add a custom check that performs an HTTP request to the UDS endpoint:
Run a check and make sure it succeeds:
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached