Skip to content
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

Timeout cannot be smaller than 1 second #10

Closed
pyrocat101 opened this issue Aug 23, 2014 · 5 comments
Closed

Timeout cannot be smaller than 1 second #10

pyrocat101 opened this issue Aug 23, 2014 · 5 comments

Comments

@pyrocat101
Copy link

If timeout passed to Channel constructor is smaller than 1.0, operations like gethostbyname would immediately timeout.

@saghul
Copy link
Owner

saghul commented Aug 24, 2014

Hi! I tried to reproduce it like this 57e3f9a but it does work for me. Do you have a test case I can try?

@pyrocat101
Copy link
Author

Hi, I am using pycares to create a getaddrinfo with timeout support. Here's an example case of timeout (actually it works for localhost, but not google.com):
https://gist.github.com/2f1bb9fd1a864feda0f4

@saghul saghul closed this as completed in 30804f8 Aug 25, 2014
@saghul
Copy link
Owner

saghul commented Aug 25, 2014

Thanks for the test case! It did help me catch the bug, it's now fixed in master :-)

As a side note, you may want to remove this if check here: https://gist.github.com/pyrocat101/2f1bb9fd1a864feda0f4#file-getaddrinfo-py-L17 doing a select for 0.0 seconds is perfectly fine, and you already checked above that there are sockets to be polled.

@pyrocat101
Copy link
Author

Thank you!

@saghul
Copy link
Owner

saghul commented Aug 25, 2014

I'll make a release with these fixes somewhere this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants