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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiprocessing: publishing with qos2 hangs at the moment of sending PUBREL. #743

Open
annt0 opened this issue Sep 1, 2023 · 1 comment
Labels
Status: Available No one has claimed responsibility for resolving this issue. Status: More info needed More information needed from issue author

Comments

@annt0
Copy link

annt0 commented Sep 1, 2023

I have extended paho.mqtt.client.Client in another custom class that I use in my program. The structure of my program is as follows:

Main thread with custom MQTT client c1.
-- Process 1 (daemon) with custom MQTT client c2.

c1 works correctly, but c2 is unable to send messages with qos2. I have tried two approaches:

  • Inside the custom clients, I manually called the network loop in a thread (I created a threading.Thread instance that runs a while loop calling loop()).
  • Inside the custom clients, I handled the network loop using loop_start() and loop_stop().

In the first case, communication stops in c2 at the sending of PUBREC by the broker:
The call to PUBLISH by c2 is logged, I see the sending of PUBREC on the broker (Mosquitto), c2 receives PUBREC, but what I noticed while debugging your client.py is that something empties the self._out_messages dictionary, and therefore, the call to self._send_pubrel(mid) cannot be made.
In the second case, c2 successfully publishes the message, but it never arrives at the broker.

With lower qos levels, everything works fine. c1 does not have these problems.

Could you tell me what could be causing this?
Thank you in advance!

@github-actions github-actions bot added the Status: Available No one has claimed responsibility for resolving this issue. label Sep 1, 2023
@MattBrittan
Copy link
Contributor

Apologies for the long delay. Unfortunately I think its going to be difficult to assist without seeing some of your code (there are too many variables here) are you able to provide a reproducible example? (client logs may also be useful).

@MattBrittan MattBrittan added the Status: More info needed More information needed from issue author label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available No one has claimed responsibility for resolving this issue. Status: More info needed More information needed from issue author
Projects
None yet
Development

No branches or pull requests

2 participants