ApplicationRunner in undefined state when opening handshake timeout is skipped
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.
ApplicationRunner should throw in this race scenario of course.
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.