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

SSLProtocol stalled during handshake #161

Closed
hynek opened this issue Jun 1, 2018 · 9 comments
Closed

SSLProtocol stalled during handshake #161

hynek opened this issue Jun 1, 2018 · 9 comments
Labels

Comments

@hynek
Copy link

hynek commented Jun 1, 2018

  • uvloop version:

0.10.0, doesn’t happen with 0.9.1

  • Python version:

3.6.5

  • Platform:

Ubuntu Xenial/Docker

  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?:

Yes, but I get no additional output.


I have to communicate with a super-slow endpoint and since 0.10.0, the connection doesn’t go thru and aborts before the timeout I specify.

Stdout gets a string like: <uvloop.loop.SSLProtocol object at 0x7f227a1a1048> stalled during handshake. It seems like there’s a second timeout in play? I did measure the handshake by hand I would guess something around 5s.

Downgrading back to 0.9.1 fixes the problem.

P.S. Bonus bug I cannot handily reproduce: sometimes I saw an AttributeError about errno not being on CertificateError or something like that.

@1st1
Copy link
Member

1st1 commented Jun 1, 2018

In 0.10.0 there's a 10 seconds timeout for the handshake operation. Is your endpoint slower than that?

It's also a default timeout for handshake in asyncio 3.7, although it's configurable via the ssl_handshake_timeout parameter to create_connection and create_server (the parameter isn't yet backported to uvloop). Do you feel that 10 seconds is not enough?

P.S. Bonus bug I cannot handily reproduce: sometimes I saw an AttributeError about errno not being on CertificateError or something like that.

That means asyncio 3.7 has this bug too. Will take a look.

@hynek
Copy link
Author

hynek commented Jun 1, 2018

Do you feel that 10 seconds is not enough?

How do you think I found out? ;) 10s is wayyy to short once you have to communicate from/to Africa or Asia. I spent a month in Cape Town and learned this the hard way.

In this case I couldn’t communicate with a server in India. If this goes into 3.7 there’s gonna be a lot of...reports. :D

@hynek
Copy link
Author

hynek commented Jun 1, 2018

It would also be great if we could do something about the output btw.

@1st1
Copy link
Member

1st1 commented Jun 1, 2018

What default timeout would you suggest?

It would also be great if we could do something about the output btw.

You mean the errno/CertificateError error? Or the "... stalled during handshake" error message?

@hynek
Copy link
Author

hynek commented Jun 1, 2018

What default timeout would you suggest

No clue! Check what browsers or Java or Go do maybe?

You mean the errno/CertificateError error? Or the "... stalled during handshake" error message?

Both ✨

Although the errno thing is a lot more severe.

@hynek
Copy link
Author

hynek commented Jun 1, 2018

(I can live with it staying at 10s btw as long as you give me a knob to turn. :))

@1st1
Copy link
Member

1st1 commented Jun 1, 2018

(a PR to CPython to fix this: python/cpython#7321)

@1st1 1st1 added the bug label Jun 1, 2018
@1st1
Copy link
Member

1st1 commented Jun 1, 2018

Fixed in v0.10.1. Please try it ;)

@1st1 1st1 closed this as completed Jun 1, 2018
@hynek
Copy link
Author

hynek commented Jun 2, 2018

Happy to report I can connect to India again. :)

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

No branches or pull requests

2 participants