publish blocks entire program
I have a really difficult problem.
I'm using paho-mqtt inside python 3.7 on mosquitto broker at an ubuntu 18.03 system. The program is a bridge between two brokers (which could surely be solved via mosquitto directly, but I did it this way).
One special defined publish command of one client object irregularely hangs the entire program, i.e. starts but doesn't come back. Even timer events are blocked. The only solution is to kill the program from outside. The command itself is obviously ok, since I can send a hundred of publishes without problem. Also try-catch doesn't help, since the pogram hangs. No other publish command of both client object in the program shows this behaviour.
Is there any chance to analyze what happens?
EDIT: I added a threading.Semaphore() on friday - during weekend all seemed to be stable. Migth this be a hint? EDIT2: Also with semaphore the call to publish blocks / hangs the program.
I have similar issue. I use loop_start and on_message callback. The callback publishes new messages on different topic. I also have a "while True" loop, which publishes something from time to time. It seems that when these two try to publish at the same time, the publish metod hangs and doesn't return.
Could you both take a look at the 1.6.x branch? I've made improvements around the locking which may help here.
hi @ralight when 1.6.x release?
I'm planning a release around the end of September.
I had a similar problem where the client.publish was taking way too long and switching to the 1.6.x branch fixed the issue
I'm getting the same thing.
I'll need to information on how to reproduce this bug, as I never had publish() which hang the program in my usage.
#710 could be the same issue: a publish which network is down could result in publish being lost. #710 is merged but not yet released.