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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages lost when using both MQTTv3 and MQTTv5 clients in async mode #618

Open
inad9300 opened this issue Feb 22, 2024 · 3 comments
Open
Labels

Comments

@inad9300
Copy link

inad9300 commented Feb 22, 2024

馃悰 Bug Report

I have a setup where I receive messages from a MQTTv5 broker at a rate of one per second, and have to forward them to a MQTTv3 broker. As such, I have a software component with two clients, one connected to each broker, using the asynchronous API flavor.

In this scenario, the MQTTv5 client receives all messages well, but sending those same messages through the MQTTv3 client behaves in such a way that the sending of 8 consecutive messages works, then the 9th times out, repeatedly.

馃敩 How To Reproduce

I have added a test case reproducing the problem in #619. It shows how the reactive API flavor handles the task well, whereas the asynchronous one is only able to send a few messages before breaking. I have not added a test using the blocking API, but I have been able to test it in my own project and it works too.

I believe the same problem exists when going from MQTTv3 to MQTTv5. Perhaps the version does not matter. I also don't know if two async clients are necessary to reproduce the issue. These are all tests worth doing and automating, in my opinion.

Environment

Ubuntu 22.04.

馃搱 Expected behavior

All messages should arrive, as is the case with the other API flavors.

@SgtSilvio
Copy link
Member

In your PR I commented on your test to explain why you run into this behavior.
It is basically caused by a threading problem in the test code and is not an issue of the library.
Feel free to comment and ask for clarifications.

@inad9300
Copy link
Author

inad9300 commented Mar 4, 2024

Could you please reopen this until fully solved? I fear it'll go unnoticed otherwise.

@pglombardo pglombardo reopened this Mar 5, 2024
@pglombardo
Copy link
Contributor

Hi @inad9300 - you're right - we'll close this issue after the discussion in #619 is complete. @SgtSilvio should loop back soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants