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

publish blocks entire program #531

Open
mhechthz opened this issue Dec 11, 2020 · 7 comments
Open

publish blocks entire program #531

mhechthz opened this issue Dec 11, 2020 · 7 comments
Labels
Status: More info needed More information needed from issue author Type: Bug

Comments

@mhechthz
Copy link

mhechthz commented Dec 11, 2020

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.

@karolszklarski
Copy link

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.

@ralight
Copy link
Contributor

ralight commented Jul 22, 2021

Could you both take a look at the 1.6.x branch? I've made improvements around the locking which may help here.

@ralight ralight added Status: Blocked Another issue needs to be resolved first, or a specific person is required to comment or reply. Type: Bug labels Aug 16, 2021
@lytasky
Copy link

lytasky commented Aug 24, 2021

hi @ralight when 1.6.x release?

@ralight
Copy link
Contributor

ralight commented Aug 24, 2021

I'm planning a release around the end of September.

@dplaks-del
Copy link

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

@David-OConnor
Copy link

I'm getting the same thing.

@PierreF
Copy link
Contributor

PierreF commented Jan 7, 2024

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.

@PierreF PierreF added Status: More info needed More information needed from issue author and removed Status: Blocked Another issue needs to be resolved first, or a specific person is required to comment or reply. labels Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: More info needed More information needed from issue author Type: Bug
Projects
None yet
Development

No branches or pull requests

7 participants