Hi, this is a funny one …
I’m using a python client against crossbar with a reconnectingclient factory, seems to work well. I can stop/start crossbar and the client happily reconnects when it can, no problems. However … I have an issue elsewhere (!) which is causing the python client to lock out the GIL (I’m assuming) by running a callInThread() with a process that then calls out a long-running system call.
After 100 seconds, Crossbar reports a “pong” failure and disconnects the client.
When the client comes back to life (another 30 seconds) it reports the disconnection, and that it will retry in 1 second.
I then reports that the factory is closed, and no further retries take place.
It would appear that a ping-pong failure at the crossbar-end is somehow breaking the client retry.
Anyone any ideas on what might be going wrong?
… if it makes any difference, it’s an SSL connection …
Client factory code looks like this;
class ComponentFactory(WampWebSocketClientFactory, ReconnectingClientFactory):
“”“WAMP Reconnect Wrapper.”""
maxDelay = 300
initialDelay = 1
factor = 1.1
debug = True
def clientConnectionFailed(self, conn, reason): """When the connection fails.""" if not reactor.running: self.stopTrying() ReconnectingClientFactory.clientConnectionFailed(self, conn, reason) def clientConnectionLost(self, conn, reason): """When the connection is lost.""" if not reactor.running: self.stopTrying() ReconnectingClientFactory.clientConnectionLost(self, conn, reason)
And the connect code;
component_config = ComponentConfig(realm=relm, extra=self) factory = ApplicationSessionFactory(config=component_config) factory.session = self.component server_url = "%s://%s:%s/ws" % (proto, host, port) transport = ComponentFactory(factory, server_url) transport.setProtocolOptions(acceptMaskedServerFrames=True) class CtxFactory(ssl.ClientContextFactory): def getContext(self): self.method = SSL.SSLv23_METHOD ctx = ssl.ClientContextFactory.getContext(self) ctx.use_certificate_file('certificate.pem') ctx.use_privatekey_file('private_key.pem') return ctx ctx = CtxFactory() connectWS(transport, ctx) return Application(name)
__ __ __ __ __ __ __ __ / `|__)/ \/__`/__`|__) /\ |__) |/ \ \__,| \\__/.__/.__/|__)/~~\| \. |\__/
Crossbar.io : 16.10.1
Autobahn : 0.16.1 (with JSON, MessagePack, CBOR, UBJSON)
Twisted : 16.5.0-EPollReactor
LMDB : 0.92/lmdb-0.9.18
Python : 3.5.2/CPython
OS : Linux-4.4.0-45-generic-x86_64-with-Ubuntu-16.10-yakkety
Machine : x86_64
Release key : RWQ2MDk26PKBMNUZG2Jok1tMBB1SKyci+N7dtcep8jrikTl4NvI1Rnux