-
Notifications
You must be signed in to change notification settings - Fork 161
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
Async MQTT client blocks on publish if the client is disconnected and waiting between reconnect attempts #554
Comments
Hi @richturner - thanks for pointing this issue out. I'll see if I can reproduce this here locally and report back soon. |
Hi @richturner - I haven't been able to reproduce this. Could you post your client creation code (with reconnect)? |
Since this issue has gone stale, I'll close it out but if you want to pick up on this again, let us know. We'd be happy to help out! |
Same problem here, have you found any solutions to this? |
It seems we are experiencing the same issue with an RxClient: It seems the connect runs into a timeout and the client does not recover from that. This is the creation Logic we use:
EDIT: This does not seem to depend on QoS of the publish. Even attaching a timeout to the completable publish does not prevent this. |
@richturner @Mystery406 @Blafasel3 Hi, We also encountered the same problem, do you have a solution? Thank you so much |
My workaround for now is to check whether client is connected to server before every push. |
@richturner @Mystery406 @Blafasel3 @pglombardo @richturner Hi, we are facing the same issue, and we check the client state before each send. Here is the code for publish message: Under most circumstances, it runs fine in prod env. This is an intermittent issue that has occurred twice in the past six months, where the thread gets locked and cannot be awakened. here is a sample stack trace: here is "com.hivemq.client.mqtt" stack trace: "com.hivemq.client.mqtt-7-2" #175 [122] prio=10 os_prio=0 cpu=1038.93ms elapsed=100918.76s tid=0x00007fd674412360 nid=122 runnable [0x00007fd77dbea000]
We can't reproduce the issue in our local env, even after trying with breakpoints. We suspect that HiveMQ's thread pool doesn't always call the notifyAll method in certain cases, but we're unsure of the cause. Could you please help investigate this issue? |
@Mystery406 @thxyoulistenme |
Hi all - I have the team take a closer look at this this week. |
Expected behavior
The async client (in my case
Mqtt3AsyncClient
) should not block when callingsend
no matter what the client state is; instead I would expect to get theCompletableFuture<MqttPublish>
Actual behavior
send
blocks the calling thread; I guess waiting for the client to be in a connected state?To Reproduce
send
call with noFuture
ever returnedDetails
The text was updated successfully, but these errors were encountered: