Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broker: client reconnect keep-alive grows infinitely and client take over not implemented #220

Open
kruton opened this issue Oct 15, 2020 · 0 comments

Comments

@kruton
Copy link

kruton commented Oct 15, 2020

It seems like if a client re-connects and a session is found in the cache, the timeout-disconnect-delay is added to the cached session's client_session.keep_alive. If the client keeps reconnecting, eventually it gets into very large values and causes some problems.

I think this is exacerbated because hbmqtt also doesn't appear to implement client take-over. Specifically it doesn't implement MQTT 3.1.1 section 3.1.4:

If the ClientId represents a Client already connected to the Server then the Server MUST disconnect the existing Client [MQTT-3.1.4-2].

Here are some recent logs that show the timeout keeps incrementing by the default timeout-disconnect-delay of 2:

2020-10-15 11:26:07,935   INFO     hbmqtt.broker: Connection from 10.100.10.1:65255 on listener 'tcp-ssl-1'
2020-10-15 11:26:08,205   DEBUG    hbmqtt.broker: Keep-alive timeout=12                                                                                                                                          
...
2020-10-15 11:26:45,360   INFO     hbmqtt.broker: Connection from 10.100.10.1:65256 on listener 'tcp-ssl-1'
2020-10-15 11:26:45,624   DEBUG    hbmqtt.broker: Found old session (Session(clientId=40285608b03f085d1b4e31ec5f60b3b912f64f2d, state=disconnected), <hbmqtt.mqtt.protocol.broker_handler.BrokerProtocolHandler object at 0x7f7cdfb299d0>)
2020-10-15 11:26:45,624   DEBUG    hbmqtt.broker: Keep-alive timeout=14 
...
2020-10-15 11:27:29,906   INFO     hbmqtt.broker: Connection from 10.100.10.1:65257 on listener 'tcp-ssl-1'
2020-10-15 11:27:30,167   DEBUG    hbmqtt.broker: Found old session (Session(clientId=40285608b03f085d1b4e31ec5f60b3b912f64f2d, state=disconnected), <hbmqtt.mqtt.protocol.broker_handler.BrokerProtocolHandler object at 0x7f7cdfb0dee0>)
2020-10-15 11:27:30,167   DEBUG    hbmqtt.broker: Keep-alive timeout=16  
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant