-
Notifications
You must be signed in to change notification settings - Fork 158
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
Using "localhost" as host rather than "127.0.0.1 blocks connections #275
Comments
Don't know why DNS resolving doesn't work on your box. |
Got the same problem. My settings:
What do I have:
It seems to be rather a bug than a reason to update documentation. |
Check your |
Same problem.
start listen only ipv4 then try to call aiopg.connect with host=localhost, port=<listening_port> |
Did you try to connect using bare |
If I add and call "wait" function from async psycopg example (http://initd.org/psycopg/docs/advanced.html#asynchronous-support) everything works ok |
Interesting |
@errx and what if you use |
listening on ::1 and connecting to |
minimal example asyncio.get_event_loop().run_until_complete(aiopg.connect("host=localhost port=12345")) |
on state == POLL_WRITE |
@errx I guess that remove-and-readd is required only if fileno() is changed. It would be really very helpful if you write a PR and check it yourself. I have not idea how to reproduce it yet in the test suite. |
I guess the key point to reproduce this issue is to have I'll try to make a PR as soon as I understand what's really going on here :) |
My hypothesis (based on tcpdump and strace) is that after first failed ipv6 connection socket is closed and than new socket is created with same fd (probably inside libpq? didn't check yet) and according to epoll man page closed descriptors will be removed from interest lists. But I'm not sure how to make a good solution for this problem |
|
I'm sorry but I'm not sure how this flag will help, care to elaborate? |
Sometimes after an attempt to listen to some port, it becomes unbindable for a while until that times out in the kernel. |
@errx can you confirm that |
Yes, fd didn't change but I guess this is not always true. I can show
strace logs but unfortunately not today
|
@asvetlov can you explain a little bit why did you add reading/writing logic split here 1ef6f94? I guess one possible solution is: btw: I've found similar issue with sslmode |
Plz look at my PR #579 It fixes issues when:
|
Hi! Could someone please look the PR? |
Friendly reminder about #579. Merging it could be a great step forward. Do you guys need any help with it? We at my work have met an issue with |
Using the example code from the documentation:
Results in this:
If I change it to "127.0.0.1" it works perfectly, however.
The text was updated successfully, but these errors were encountered: