-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
TCPSocket not seeing docker network? #2426
Comments
If I remember correctly, based on what @waj told me (but I might be wrong), we are using |
So basically that's the reason: Ruby uses the C library, we are not (but we should). But that means we need to replicate all of what |
I can confirm: DNS resolution are blocking calls, and as such can potentially block the event loop for a long time, which is bad, obviously. We thus rely on libevent's async DNS, which is evented, but uses its own custom resolver that reimplements Problem is, it's kind of limited. |
That being said, how does docker resolver works? Does it set anything into the |
Docker for Mac beta does not set anything in the https://beta.docker.com/docs/mac/experiment/#user-space-networking-vpn-hostnet |
That link may require a docker login. |
Hosts in the I was recently playing around the idea of stop using the name resolution from libevent, and use native services provided on each platform instead. For example, in Linux there is |
Hit this trying to connecto to postgres inside a docker network. It's not quite the same network because it's not a conninfo = PQ::ConnInfo.from_conninfo_string(ENV["DATABASE_URL"])
host = `getent hosts #{conninfo.host} | awk '{ printf $1 }'`
conninfo = PQ::ConnInfo.new(host, conninfo.database, conninfo.user, conninfo.password, conninfo.port, conninfo.sslmode)
PG.connect(conninfo) Turns out shelling out was the easiest solution... |
I want to just poke at the idea of possibly re-evaluating abstraction-and-events framework when the concurrency discussions phase starts. I'm still not to sure about libevent personally, there are many options. |
I looked around to see what node/libuv and go do to avoid the problem:
|
Closing in favor of #2660 |
This is a tricky one to report and I'm not sure what all details will help track down the root of the issue, so let me know what I can do to help.
Running the following code against the latest Docker for Mac beta (which may, in itself be part of the problem):
Returns the following
However, using Ruby (which I believe to be based off of the same C socket library, performs correctly:
Which prints out the request body of the API as I expect (this was run in the REPL).
If I swap the
docker.local
hostname for the IP the hostname resolves to, it works properly. However I would expect this not to be an issue. Anything I can give you to help chase this down?The text was updated successfully, but these errors were encountered: