-
Notifications
You must be signed in to change notification settings - Fork 57
log errors encountered #61
base: master
Are you sure you want to change the base?
Conversation
This should not be really needed. There exist some contracts between the transport layer and the WAMP client/router logic layer - which unfortunatly haven't been documented - but which shoudl handle the situation correctly:
If there is any issue where the current implementation does not match this described behavior it should be considered as a bug which really should be found and fixed - instead of logging the calls. |
i was bitten by this bug twice. when i was testing msgpack serialization on big-endian systems, there was a bug in msg-pack library. see msgpack/msgpack-java#266 to reproduce this: just add following line at WampDeserializationHandler:95 if(true) throw new RuntimeException("thrown intentionally") now run |
if wamp serializer/deserializer throws any error, then state remains in Connecting for-ever. no error in log. atleast logging will give some clue to users
Hi I tested this and everything worked as intented. The throwed exception leads to the netty exception handlers being invoked, which will close the connection. Then the WampClient/StateController will get notified that the connection was closed. The internal state will then move from HandshakingState to WaitingForDisconnectState to WaitingForReconnectState to ConnectingState to HandshakingState and will try to Reconnect, just as I explained above. This means the clients internal state changes. What doesn't change is the state that is propagated to the user. From his point of view the client is always in the Connecting state. The intentation was that if the client wants automatic reconnects it isn't interested in incomplete connection attempts and thereby disconnected -> connecting -> disconnected cycles. If you don't use infinite reconnects but a limited number then the statemachine will eventually move to Disconnected. If introducing logging would be helpful, then I would prefer to include logging for the state machine transisitions (either in the StateController or in the individual states) and not for the individual calls, because as I said the errors for those are already handled by the QueueingConnectionController. |
if wamp serializer/deserializer throws any error, then state
remains in Connecting for-ever. no error in log. atleast
logging will give some clue to users