-
Notifications
You must be signed in to change notification settings - Fork 101
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
Unix transport used when HTTP host is specified #99
Comments
I can repro this as well - Repro Steps
Expected results: Actual results: the problem goes away if you change the go.mod to go-connections v0.4.0 |
I think the fix is to update the TCP codepath to set DialContext to nil and DisableCompression to false -- effectively to "undo" http.Transport changes made by the Unix socket and npipe codepaths. But I also don't 100% understand the contract of this function or how it's used |
…nnections` package The package `github.com/docker/go-connections` only exists in contrib's generated `go.mod` file in version `v0.5.0`, and does not exist in the replaced version `v0.4.1`. The distro also builds and runs fine without the replace directive. I believe the [reason](open-telemetry/opentelemetry-collector-contrib#12322 (comment)) for the replace directive to have been added is out of date. To be sure, I have run the repro scenario described [here](docker/go-connections#99 (comment)) and the behavior with go-connections v0.5.0 was correct - the Docker client tried to connect to the TCP port.
…nnections` package (#677) The package `github.com/docker/go-connections` only exists in contrib's generated `go.mod` file in version `v0.5.0`, and does not exist in the replaced version `v0.4.1`. The distro also builds and runs fine without the replace directive. I believe the [reason](open-telemetry/opentelemetry-collector-contrib#12322 (comment)) for the replace directive to have been added is out of date. To be sure, I have run the repro scenario described [here](docker/go-connections#99 (comment)) and the behavior with go-connections v0.5.0 was correct - the Docker client tried to connect to the TCP port. Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Here is a demo repo that demonstrates the bug. You can toggle on/off the
replace
in thego.mod
in order to switch the bug on and off. The example uses the docker client. This problem doesn't exist in0.4.0
.There's a problem in master currently where it overrides the proto and doesn't reset it when a new scheme is applied. This had the effect of making request to a unix socket even though an http endpoint was specified for the docker engine.
A debugging session indicated the problem was from a removal of piece of code in
sockets.go
, which was changed here: https://github.com/docker/go-connections/pull/61/files#r923998601The issue seems possibly related to the following which also had trouble making TCP connections:
The text was updated successfully, but these errors were encountered: