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

Removing a message should reduce in flight count

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

Description

Please fill out the form below before submitting, thank you!

- [* ] Bug exists Release Version 1.2.0 ( Master Branch)
- [* ] Bug exists in MQTTv3 Client on Snapshot Version 1.2.1-SNAPSHOT (Develop Branch)
- [ ] Bug exists in MQTTv5 Client on Snapshot Version 1.2.1-SNAPSHOT (Develop Branch)

If this is a bug regarding the Android Service, please raise the bug here instead: https://github.com/eclipse/paho.mqtt.android/issues/new

Using the MqttAsyncClient, messages occasionally fail to publish correctly and the message gets stuck in the system. Using a monitor and waiting for the onPublish / onSuccess to fire generally works fine and the monitor is woken on successful publish and we send the next message, however when the onPublish / onSuccess does not happen we need to free up the message id using the client.remove(token) method. This removes the message and token from the system but fails to reduce the actualInFlight count. The net result is after a while, we use up all 10 slots with these messages that go missing and the client fails.

Shouldn't the remove method also reduce the counter to keep everything in step?

Contributor guide

Open the contributing guide

Research direction

Start at the MqttAsyncClient.remove(token) entry point and trace how the message and token are removed alongside actualInFlight. Reproduce the missing onPublish/onSuccess scenario with the MQTTv3 client, then verify that removing a stuck message frees an in-flight slot and the client can continue publishing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.