crossbario / autobahn-python

WebSocket and WAMP in Python for Twisted and asyncio
https://crossbar.io/autobahn
MIT License
2.48k stars 770 forks source link

ApplicationRunner in undefined state when opening handshake timeout is skipped #960

Open aberres opened 6 years ago

aberres commented 6 years ago

For testing purposes, I am trying to find out when a crossbar router is available and accepting connections.

When the router is not yet started the autobahn.asyncio.wamp.ApplicationSession throws a ConnectionRefusedError. Once the router is ready a session is established as expected.

Now my problem: If the router is starting up while I try to connect I get the following log message from onOpenHandshakeTimeout(): skipping opening handshake timeout: WebSocket connection is already closed

Now the main loop runs apparently forever and nothing happens. Is there any way for me to detect this situation? Is there a callback I should overwrite? I was not able to find one.

oberstet commented 6 years ago

ApplicationRunner should throw in this race scenario of course.

aberres commented 6 years ago

FWIW this is always reproducible. I tried against the dockerized crossbar.io in the Cpy3 and the PyPy version.

Autobahn version is 18.3.1.