eclipse-paho / eclipse-paho/paho.mqtt.java

broken broker sending MsgID 0 can kill PAHO client with "out of new message IDs"

Open
#344 1 comment 0 reactions 0 assignees View on GitHub
triage
Dominant language
Java
Stars
2.3k
Forks
919
PR merge metrics
No merged PRs in 30d

Description

- [X] Bug exists in 1.1.1-SNAPSHOT from 20170320

The Moquette broker had an issue where under some circumstances it was sending messages with ID=0 (see https://github.com/andsel/moquette/pull/286).

If it was sending a QoS1 PUBLISH with ID=0, the PAHO client would create a new MqttPubAck which also has ID=0 which would (in the send method) then be seen as "we need a new ID!" - that new ID is never removed from the pool as it was created for a message which *actually* didn't need it. Even worse: Somehow the PubAck keeps looping and there is not only one ID wasted but all of them nearly at once (didn't trace why *that* happens though)

I'd suggest to ignore messages from ill-behaving brokers and log a warning

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.