Experimental patch that enforces IPV4 #16
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.
This moves the core HTTP client into an external crate and implements a custom resolver to attempt to limit connections to IPV4 only.
The reasoning for the external crate: it simplifies debugging this and enables swapping out the underlying HTTP client adapter for any further debugging. I wouldn't necessarily consider this design complete and/or necessary, but this bug is tricky to reproduce and I'm not jumping over a bunch of files hunting down imports.
The reasoning for the bug: GCP appears to have some oddities with regards to IPV6 support, and if a device is configured to be IPV6-capable and a user does not have a DNS cache entry for the API, they may run into a randomly broken connection. I believe we never saw this with the curl connections that were in use on the C++ side as that implements a happy-eyeballs flow that attempts to find the "best" route and follow it accordingly. This patch just attempts to restrict things to ipv4 which we know works.
This patch is subject to further iterations as it may require vending a few debug builds to users to see if it works out.