Do not decrease inflight messages on PUBREL#884
Conversation
When a QoS 2 message is received, the inflight messages was decremented on `PUBREL`. But the inflight messages must be a count of sent but not received messages. This yielded a negative inflight count for QoS 2 messages. This change removes this decrement and fixes eclipse-paho#805. Signed-off-by: Ruben Bär <ruben@baer.sh>
PUBRELPUBREL
|
Hi Ruben, thanks for the PR. Sorry it's been over a year for a response. The PR is super simple, and I can reproduce the original bug. I also confirm this PR fixes it, and that nothing breaks for QoS 0 and QoS 1 published messages. @PierreF Once this is rebased on to master, and passes the checks, it should be merged. The original code looks straight forward - self.max_inflight_messages_set is a cap on the number of messages being published at once, and self._inflight_messages counts them. It looks to me like there's nothing more to it, than the original author of the QoS 2 code adding another decrement to Discussions on the original PR that added this decrement, were more concerned by other matters, that were perhaps more pressing at the time. Perhaps that PR's author simply forgot about the original decrement they added 2 years earlier |
When a QoS 2 message is received, the inflight messages was decremented on
PUBREL. But the inflight messages must be a count of sent but not received messages. This yielded a negative inflight count for QoS 2 messages.This change removes this decrement and fixes #805.