hivemq-mqtt-client icon indicating copy to clipboard operation
hivemq-mqtt-client copied to clipboard

MQTT client receives same message multiple times when its session terminated by network or system error or broker sending Disconnect to client.

Open vshirol opened this issue 2 years ago • 0 comments

          [threadump_before_conn_reset.zip](https://github.com/hivemq/hivemq-mqtt-client/files/11913281/threadump_before_conn_reset.zip)

threadump_after_2times_conn_reset.zip Hi @pglombardo The above-mentioned issue is solved with your proposed code change. Thanks. But we do see similar problem in different scenario, that is when MQTT broker terminates client connection by sending Disconnect MQTT packet to client or when connection reset occurs on client side, in this case MQTT broker is still running and not restarted.

So, in these scenarios with above mentioned code change doesn't help, client receives the duplicate message which is equal to number of times its connection reset either by broker or system error or client-side network issues. Let me know if you need any more details from my side.

From thread dump we do see, upon every connection reset there is an increase in RxComputationThreadPool instance. Attaching thread dump of both normal and after 2 times connection

Thanks, Vasant

Originally posted by @vshirol in https://github.com/hivemq/hivemq-mqtt-client/issues/552#issuecomment-1614156291

vshirol avatar Jul 06 '23 08:07 vshirol