Comments (1)
@KSDaemon I tried to fix this issue, but then I realized some things.
A transport may have issues before and after the session creation. For example when a cluster is rolled out and the router is avalable after the client. The client would have to try to reconnect until the router is available. Also if the router for some reason crashes after the session creation and the client then reconnects after the router has been restarted.
Connectanum-dart only reconnects if transport layer issues appears. If the router kills the connection with an Abort
, the client will not try to restart. This is done by having two Completer
the onConnectionLost
and onDisconnect
. Only onConnectionLost
will make the client try to reconnect. The Session
and the Client
object will only call the onDisconnect
or transport.close()
if something on the wamp
-layer happens.
I had to fix one issue. When adding the wamp.error.no_such_role
, wamp.error.no_such_topic
and the wamp.error.no_such_session
authentication error, one must have missed to add it to the authentication failures in the client.dart
. I will add this and push it later.
So I think:
Transport failures before session is established
Transport failures during session. Definitely the most important point to proceed with reconnection (if it is configured)
Should lead to a reconnect, if configured
Wamp abort (due to auth or other reasons) before session is established. Wamp error means that server processed client messages and get to some point that resolves in abort. Does auto reconnection fix this? Seems that not.
Wamp failures during session. Seems that this situations should not lead to reconnection. As they happens when something is broken on business logic side (like using feature that is not announced, using serializer that is not supported etc), so autoreconnection won't automatically fix them.
This should be configurable. The client currently has an Error
map that will decide if the client will try to reconnect on auth problems. This will only happen once. There is no second retry. Imagine a situation where a client tries to authenticate, but the database is not up or down at the moment. The router must fail the authentication and it might do so with a lie to hide the original reason. If the client tries to reconnect and the database is available again, the authentication would succeed the second time. So I guess even this scenario should be configurable.
connectanum-dart/lib/src/client.dart
Lines 100 to 112 in 3bbb488
If a session has been esteblished an Abort
will lead into a transport.close()
and thus into a onDisconnect
which will not start a reconnect. Due to the WAMP protocol definition a protocol violation will send an Abort
. An Error
should not be a reason for a connection loss.
connectanum-dart/lib/src/protocol/session.dart
Lines 180 to 185 in 3bbb488
So what do you think?
I think I should make it more configurable. Add a reconnectOnAuthError:bool
and a authErrorForReconnectList:array
or something like this. And maybe have a special handler that will be notifyed on Abort
. The individual client may decide wether to reconnect or not?
from connectanum-dart.
Related Issues (20)
- Add way more logging!
- Resubscribe to Topics on Reconnection HOT 2
- Was there dublicate sessions fix from version 1.0.6 to 1.1.6 HOT 1
- WAMPCRA: Only derive key when `salt` present in Challenge HOT 11
- Session call arguments type HOT 2
- session.publish seem to stuck HOT 4
- Session.publish with PublishOptions(acknowledge: false) waits for `PUBLISHED`
- Strange behaviour of Session.publish and/or Session.subscribe HOT 2
- Session.call seem to block HOT 3
- Cache stored key for scram authentication
- Support multiple serializers HOT 18
- Implement CBOR serializer HOT 15
- Implement Payload PassThru Mode HOT 4
- Flaute WebApp Chrome Webhost is not supporting dart.html HOT 9
- Auth failure response doesn't seem right HOT 19
- not connect websocket HOT 2
- Currently the connection doesn't support authextra HOT 2
- Unable to catch error HOT 7
- Support dart2wasm compilation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from connectanum-dart.