RPC remain registered after connection is lost
See original GitHub issueMy client side environment: Google Chrome 40.0.2214.111 (Official Build) Revision 6f7d3278c39ba2de437c55ae7e380c6b3641e94e-refs/branch-heads/2214@{#480} OS Mac OS X Blink 537.36 (@189455) JavaScript V8 3.30.33.16
My server side environment: Crossbar.io package versions and platform information:
Crossbar.io : 0.9.11
Autobahn|Python : 0.9.3-3 WebSocket UTF8 Validator : wsaccel-0.6.2 WebSocket XOR Masker : wsaccel-0.6.2 WAMP JSON Codec : ujson-1.33 WAMP MsgPack Codec : msgpack-python-0.1.10 Twisted : 14.0.2-EPollReactor Python : 2.7.3-CPython
OS : Linux-3.13.0-39-generic-x86_64-with-Ubuntu-12.04-precise Machine : x86_64
I have client-side JavaScript running within the browser that registers RPC handlers. These handlers function as expected while I am connected (using a corporate VPN). When I reconnect after the connection is dropped (the VPN goes down) I encounter the following:
Potentially unhandled rejection [1] {"error":"wamp.error.procedure_already_exists",
"args":["register for already registered procedure 'com.example.rpc'"],"kwargs":{}}
(WARNING: non-Error used)autobahn.js:12110 (anonymous function)
I believe these should automatically unregister when the connection is lost. However I would be satisfied with a means to remove the orphaned registrations.
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
I’m seeing this issue even when using auto_ping. I’m using crossbar 16.10.1 with autobahn.js clients. The problem is that registrations are left hanging even though the session is detected as disconnected. So when I query registration details I get the following:
{ id: 7893628210237042, invoke: ‘single’, match: ‘wildcard’, created: ‘2017-04-11T20:34:03.341Z’, uri: ‘com.myprocedure’, callees: [ null ], calleeCount: 1 }
When I restart the client its unable to create the registration again. Is there any way to explicitly delete the registration without a callee session id ?
I’ve tried to reproduce this using a small test but have been unable to do so but its happening quite a lot on our deployments. This is related to crossbario/crossbar/issues/980
Any suggestions on what I could try to help reproduce this as its a big problem for us ?
@shaworth Crossbar.io automatically unregisters all registrations (and subscriptions) a client has established when it detects that the client connection is gone. When the VPN silently drops the TCP connection, this goes unnoticed on the server side. This is an aspect of TCP: when no data is sent, a dead connection can go unnoticed for a long time.
For these reasons, Crossbar.io has options for WAMP-over-WebSocket to do automatic WebSocket ping/pong for fast detection of dead connections. Have a look at the docs here http://crossbar.io/docs/WebSocket-Options/
Try these settings:
This means, every 1000ms Crossbar.io will send a WebSocket ping of payload size 4 bytes. When that ping isn’t replied within 2000ms, Crossbar.io will assume the connection to be dead.